Sponsored Content
Top Forums Shell Programming and Scripting Script for updating the comments field on /etc/passwd on redhat linux Post 302275455 by Linux Duke on Saturday 10th of January 2009 02:19:42 PM
Old 01-10-2009
Hi Guys,

May I please get help with this problem, I have been trying a lot of things and I'm not winning this script keeps deleting user account.I did it on a different server then used chfn but it did not solve the problem. Please help me I have 300 server that I need to update the comment field on and I'm desparate for this to work.

+-----------------------------------------------------------------------------+
genlnx@server2's password:
Last login: Tue Jan 10 16:07:06 2009 from 192.168.1.3
id: cannot find name for user ID 415
id: cannot find name for user ID 415
[I have no name!@server2 ~]$
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Updating Kernels and video drivers in Redhat 8.0

Hi. I have a few "newbie" questions. This is a 2 part question which I was unable to find an answer. First, I have recently installed the kernel patch and video driver from Nvidia for my GeForce Ti 4800 video card for 3d on a fresh install of Redhat 8.0. I need to do all of the updates for Redhat.... (1 Reply)
Discussion started by: jeremiebarber
1 Replies

2. UNIX for Dummies Questions & Answers

Trying to extract a field from /etc/passwd file..

Hello, was looking for some help on extracting a field from the passwd file. So far I have made a copy of the passwd file and changed my rights so I can edit it. Every user's password is coded as an :x:, and my goal was to change that x to a blank, and then try to extract any user with that field... (2 Replies)
Discussion started by: xBuRnTx
2 Replies

3. Shell Programming and Scripting

Updating the comments field on /etc/passwd

Hi there, I have more that 300 servers that I need to updated the comments field on /etc/passwd for users that have a blank comments fields. The users have accounts on different servers. I have created a list of these users on a text file called update.txt check below. I need a script that... (11 Replies)
Discussion started by: Linux Duke
11 Replies

4. Shell Programming and Scripting

simple CSH Script behaves differently on Solaris and RedHat Linux

I have a simple csh-script on a Solaris Workstaion which invokes the bc calculator: #!/bin/csh set shz=2 set zshift=5 set shzp=`bc -l <<END \ scale = 3 \ -1. * $shz + $zshift \ END` echo $shzp The result ($shzp) in this case is 3 (-1*2+5). It works fine on Solaris 8. ... (2 Replies)
Discussion started by: two reelers
2 Replies

5. Shell Programming and Scripting

Sed script, changing all C-comments to C++-comments

I must write a script to change all C++ like comments: // this is a comment to this one /* this is a comment */ How to do it by sed? With file: #include <cstdio> using namespace std; //one // two int main() { printf("Example"); // three }//four the result should be: (2 Replies)
Discussion started by: black_hawk
2 Replies

6. Red Hat

Updating RedHat 5.1

Hi all, Can any one tell me how I can update RedHat 5.1 without it getting upgraded to 5.5? Thanks (1 Reply)
Discussion started by: Obi-Wan
1 Replies

7. Shell Programming and Scripting

How to make a command same as PICO in linux but with comments

Hello, i need to make a linux command but i dont know how.. my proposal is to make a command same as pico but with comments.. for example if i enter picoc, it will run like pico but with this comments.. #================================== #Script Name: #By: #Date: #Purpose: ... (2 Replies)
Discussion started by: jrdncchr
2 Replies

8. Red Hat

Redhat Cluster updating kernel setting

hello, I was going through clustering documentation for Redhat, it says "Enable IP Aliasing support in the kernel by setting the CONFIG_IP_ALIAS kernel option to y. When specifying kernel options, under Networking Options, select IP aliasing support", I knew I should update /etc/sysctl.conf with... (1 Reply)
Discussion started by: bobby320
1 Replies

9. Solaris

Passwd -l or -u modifies lastchg field in /etc/shadow file

Hi, I have a Solaris 10 box where password aging is not functioning properly. Using the passwd command with the -l or -u options causes the lastchg field in the /etc/shadow file to be modified. Therefore, if a user's password is set to expire in 90 days and they are 1 day away, all they have... (4 Replies)
Discussion started by: cschar
4 Replies
CHFN(1) 							   User Commands							   CHFN(1)

NAME
chfn - change real user name and information SYNOPSIS
chfn [-f full_name] [-r room_no] [-w work_ph] [-h home_ph] [-o other] [user] DESCRIPTION
The chfn command changes user fullname, office number, office extension, and home phone number information for a user's account. This information is typically printed by finger(1) and similar programs. A normal user may only change the fields for her own account, subject to the restrictions in /etc/login.defs. (The default configuration is to prevent users from changing their fullname.) The superuser may change any field for any account. Additionally, only the superuser may use the -o option to change the undefined portions of the GECOS field. These fields must not contain any colons. Except for the other field, they should not contain any comma or equal sign. It is also recommended to avoid non-US-ASCII characters, but this is only enforced for the phone numbers. The other field is used to store accounting information used by other applications. If none of the options are selected, chfn operates in an interactive fashion, prompting the user with the current values for all of the fields. Enter the new value to change the field, or leave the line blank to use the current value. The current value is displayed between a pair of [ ] marks. Without options, chfn prompts for the current user account. CONFIGURATION
The following configuration variables in /etc/login.defs change the behavior of this tool: CHFN_RESTRICT (string) This parameter specifies which values in the gecos field of the /etc/passwd file may be changed by regular users using the chfn program. It can be any combination of letters f, r, w, h, for Full name, Room number, Work phone, and Home phone, respectively. For backward compatibility, yes is equivalent to rwh and no is equivalent to frwh. If not specified, only the superuser can make any changes. The most restrictive setting is better achieved by not installing chfn SUID. FILES
/etc/login.defs Shadow password suite configuration. /etc/passwd User account information. SEE ALSO
chsh(1), login.defs(5), passwd(5). User Commands 06/24/2011 CHFN(1)
All times are GMT -4. The time now is 04:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy