2

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...

Hello71
  • 8,397
  • 5
  • 40
  • 44
nicorellius
  • 6,625
  • 13
  • 44
  • 75

1 Answers1

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
  • 111,361
  • 10
  • 201
  • 247
  • ...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 Apr 29 '10 at 21:24
  • Right, yes. Copy, then change permissions. Files should be 0600, directories should be 0700. – Ignacio Vazquez-Abrams Apr 29 '10 at 21:40