PINE64
Chaning Username in Terminal - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: Pinebook (https://forum.pine64.org/forumdisplay.php?fid=76)
+--- Forum: General Discussion on Pinebook (https://forum.pine64.org/forumdisplay.php?fid=77)
+--- Thread: Chaning Username in Terminal (/showthread.php?tid=4662)



Chaning Username in Terminal - Coyote - 06-30-2017

Hello all,

Sorry if i already missed the posting but I have been trying to change the username in the terminal from somthing other than pine64@pinebook. I have changed my name on login but in the terminal still keep the old username. I also tried using:


Code:
    usermod -l newname pine64


and i get the message:


Code:
    usermod: user pine64 is currently used by process 941


The number at the end changes but I get the message everytime I have tried.

Is is possible to make this modification?

Thank you,

Coyote


RE: Chaning Username in Terminal - jordanjay29 - 06-30-2017

https://unix.stackexchange.com/questions/233614/when-trying-to-change-username-terminal-tells-me-user-is-currently-used-by-proc

Short answer: Change usernames from another user


RE: Chaning Username in Terminal - Luke - 06-30-2017

Its possible to do - but quite tricky to also change home folder name etc., Why not just create a new user and add to relevant groups ?


RE: Chaning Username in Terminal - zer0sig - 07-01-2017

adduser, deluser (if you like), and the copying over of files if necessary should cover everything in principle.


RE: Chaning Username in Terminal - Coyote - 07-01-2017

Hello all,

Thank you all for the replies. Not logging in the pine64 account and logging in as root and changing the username worked.

Coyote


RE: Chaning Username in Terminal - pfeerick - 07-03-2017

Yeah, you can't change the username if that user is logged in. Basically what is needed to rename/move is:

sudo passwd root [to set the root password]

logout of your account [ie. pine64]

log in to root account [using newly set password]

usermod -l new-login-name -d /home/new-login-name -m pine64 [renames pine64 to new-login-name, moves home directory]

logout out of root, log back in as new-login name

run sudo passwd -l root to lock the root account again if you wish. use passwd (without sudo) to change the password of the newly renamed account if it is still pine64 Wink