[ale] ubuntu create another user and remove old user

David Tomaschik david at systemoverlord.com
Mon Feb 28 22:57:36 EST 2011


On 02/28/2011 09:00 PM, John Scott wrote:
> Narahari wrote:
> 
> "I want to be able to make this new user devuser the only user and removed devpid.  Also I want to give devuser the rights to be sudo."
> 
> 
> Narahari,
> 
> The quickest is to become root and make your changes:
> 
> $ sudo su -
> # /usr/sbin/usermod -l devuser devpid
> 
> This will change the devpid login's username to devuser.
> 
> If you want to change the home directory name as well, add the following steps:
> 
> # mv /home/devpid /home/devuser
> # /usr/sbin/usermod -d /home/devuser devuser
> 
> Not that it matters much, but you can consolidate to three commands by adding the -d option in the command above to the first usermod you did to change the username.
> 
> -John

2 points:
1) You couldn't do this as devpid.  usermod will not modify the username
of a user who is currently logged in.
2) This turns devpid INTO devuser, rather than creating a new account
for devuser to give the user a fresh start.


David


More information about the Ale mailing list