Solved

Change Username with Usermod utility

Posted on 2001-07-16
4
2,782 Views
Last Modified: 2010-08-05
Have a user account with username

whitmanb

want to change the username on his

account to

whitman

no "B"

Using solaris 7.X

how on the command line using the usermod
utility would u do this

without creating a new account

thanks in advance.  
0
Comment
Question by:zipdog44
4 Comments
 
LVL 1

Expert Comment

by:kawin
ID: 6288205
User can't change login name!!!!  It restrict by OS.

Only "root" can change username.
0
 
LVL 3

Expert Comment

by:tdaoud
ID: 6288314
As kawin said...if you intend to let users change their names, then you can't, only root can do that.

IF yo uare asking how to do it, then I don't think you can do it easily through a command line (I'm not sure if usermod has options to do that), but all you need to do is change it in the /etc/passwd file.  You can write a small script if you want to use it from the command line, but it is  better to edit the /etc/passwd file in the usual and appropriate ways "vipw".  Otherwise you may need to rebuild some database files after changing usernames through a script file.

Good Luck,

Tarik
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 50 total points
ID: 6290310
su root -c "usermod -l whitman"
0
 
LVL 6

Expert Comment

by:bira
ID: 6290354
Log on as whitmanb and run this

  passwd


          It will prompt for the old password, then
          for the new password, twice.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now