Solved

Change Username with Usermod utility

Posted on 2001-07-16
4
2,791 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
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…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

713 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