Pages

Monday, June 2, 2014

How to make user home folder after account creation

I created a new user with useradd name and forgot to use -d -m to create their home directory. I tried making one, copying the contents of /etc/skel, and chowning everything to the new user.
Aliases don't work, such as ll, and I just have a $ at the command prompt, instead of name@server ~$. Also, using the scroll wheel dumps garbage on the command line :(
How do I fix this, or is it easier to delete the user and start over?

I just ran into this (Ubuntu 12.04) and I solved it by creating a temp user, copying over the user directory, chowning it, and finally deleting the temp user.
sudo adduser temp
sudo cp -r /home/temp /home/name
sudo chown -R name.name /home/name
sudo deluser temp 

No comments:

Post a Comment