useradd not creating directory
I'm trying to create a standard user account since sometimes I do some work that doesn't require root. However, for some reason it doesn't seem to create the home directory for the user. I've tried
useradd -d /home/username username
and it creates the user just fine, /etc/passwd shows that the home directory should be as listed, but when you visit /home no directories are listed.
Furthermore, when I log in with the user and run startx, the desktop shows all items in / , as if / is the current home directory.
Does anyone know what the problem is? I tried just doing a simple mkdir /home/username as well to make the directory, but then other errors come up saying some files are missing in the directory for the user. I imagine if useradd creates the home directory, it would create all necessary files as well. However, it's just not creating it.
Also, I did notice that in addition to the home directory not being correct, when logged into KDE the menu wasn't nice either. There was no backtrack menu item with all the tools organized well - instead they are all in a lost+found menu item, but there are so many they don't all fit on the screen. Is there an easy way to get the menu working the same for additional users as it does for root?
I don't have the backtrack manual in front of me, but the version supplied with Fedora suggests that you ought to (if I'm reading this correctly)have done it with the -k option, which copies skeleten files. Could you do
useradd -kd /home/username username
That might do nothing,I'm not sure I understand that part of the manual. I've never heard of this with useradd. Good Luck.
I tried the k flag but couldn't seem to get it to work. It said the k flag is only allowed with the m flag. So I tried -km and I got the same message. I tried -k -m and got the same message. A little weird. But, I tried just m, and it worked. m creates the directory. I suppose d just sets the directory.
Originally Posted by oldcrank