Created User in Linux (Ubuntu) Without Creating a Home Directory - Causing Problems

2

1

This may be a rookie mistake, but I created a user (new user) in Linux on a Ubuntu system and didn't actually create the home directory for this user. Now, when I log in, it says there are problems... If I delete the path home/<new user> and try to log in the system tells me I can use root as home directory but I will likely experience problems, and then it won't let me log in.

What is the best way to create this directory with the appropriate permissions? Should I just create another user and delete this one? I need some help...

nicorellius

Posted 2010-04-29T20:03:43.727

Reputation: 5 865

Answers

2

Create the directory, chown it to <new user>:<new group>, chmod it 0700, and copy all the contents, including hidden files, of /etc/skel to the new home directory.

Ignacio Vazquez-Abrams

Posted 2010-04-29T20:03:43.727

Reputation: 100 516

...and then make sure the path to that directory is set properly as the user's home in /etc/passwd ... also, it's probably better to copy the contents of /etc/skel to the new home directory before chown -ing and chmod -ing it. – quack quixote – 2010-04-29T21:24:14.090

Right, yes. Copy, then change permissions. Files should be 0600, directories should be 0700. – Ignacio Vazquez-Abrams – 2010-04-29T21:40:28.610