View previous topic :: View next topic |
Author |
Message |
thechosen0ne n00b
Joined: 23 Jan 2004 Posts: 36
|
Posted: Wed Jan 28, 2004 4:10 am Post subject: HELP! I deleted my /home directory!!! |
|
|
I just got gentoo installed and working so nicely... then i go and accidentally delete /home...
How can I rebuild this folder? I'd imagine I have to set certain permissions on the folder (which is the main part i need to know) and then remove and add my user name to recreate the user's directory.
Thanks for the help! |
|
Back to top |
|
|
DopeGhoti Tux's lil' helper
Joined: 17 Jan 2004 Posts: 100 Location: Vermont, US
|
Posted: Wed Jan 28, 2004 4:30 am Post subject: |
|
|
as root,
Code: | mkdir /home
chown root /home
chgrp root /fome
chmod 755 /home
| And for all the users on your system, Code: | mkdir /home/username
chown username /home/username
chgrp users /home/username
chmod 700 /home/username |
_________________ A proud member of the No post left unanswered Club! |
|
Back to top |
|
|
ender wiggin Tux's lil' helper
Joined: 08 Feb 2003 Posts: 119 Location: CO
|
Posted: Wed Jan 28, 2004 4:33 am Post subject: |
|
|
mkdir /home
mkdir /home/username
cp /etc/skel/* /home/username
chown -R username.users /home/username
chmod 700 /home/username
...should get you a working home dir. Remember to replace "username" with your actual login. Hope you didn't have any files there yet! _________________ "There is no teacher but the enemy." |
|
Back to top |
|
|
ender wiggin Tux's lil' helper
Joined: 08 Feb 2003 Posts: 119 Location: CO
|
Posted: Wed Jan 28, 2004 4:44 am Post subject: |
|
|
DopeGhoti - you must type quicker than I do
Some comments - since you run mkdir /home as root, it will already have user and group set to root.root. Also, with the default umask of 022, the new directories will have 755 by default.
You also want to copy the files from /etc/skel/ to each home dir - that gives the user a .bash_profile and a .bashrc to set up their shell. This is done by useradd by default.
What do you think? _________________ "There is no teacher but the enemy." |
|
Back to top |
|
|
thechosen0ne n00b
Joined: 23 Jan 2004 Posts: 36
|
Posted: Wed Jan 28, 2004 6:01 am Post subject: Yay! |
|
|
Thanks! All I needed to do was
Code: |
mkdir /home
chown root /home
chgrp root /home (mis-typed as fome)
chmod 755 /home
userdel username
useradd name -m -G users,wheel,audio -s /bin/bash
|
The chown chgrp and chmod were the parts I didn't know about. Hopefully this helps anyone else who does something similarly stupid. |
|
Back to top |
|
|
|