[ale] ubuntu create another user and remove old user

John Scott John.Scott at peak10.com
Tue Mar 1 10:56:21 EST 2011


-----Original Message-----
From: ale-bounces at ale.org [mailto:ale-bounces at ale.org] On Behalf Of John Scott
Sent: Tuesday, March 01, 2011 10:46 AM
To: Atlanta Linux Enthusiasts
Subject: Re: [ale] ubuntu create another user and remove old user

-----Original Message-----
From: ale-bounces at ale.org [mailto:ale-bounces at ale.org] On Behalf Of David Tomaschik
Sent: Monday, February 28, 2011 10:58 PM
To: ale at ale.org
Subject: Re: [ale] ubuntu create another user and remove old user

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.

> That is why I recommended doing "sudo su -" first.
> It works.  I tested before sending.

Let me clarify.  It worked on a system where the only instance of my login was the one I executed the "sudo su -" from.  In other words, I was not logged into a window system session and executing the commands from a subsequent terminal.  I was logged in via SSH with no other logins active.  I agree that this wouldn't work if you were logged in multiple times with the user you were trying to modify.  However on a terminal where the login is the only one and you become root via "sudo su -", it works and works fast.

-John


_______________________________________________
Ale mailing list
Ale at ale.org
http://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo



More information about the Ale mailing list