Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
HELP! I deleted my /home directory!!!
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
thechosen0ne
n00b
n00b


Joined: 23 Jan 2004
Posts: 36

PostPosted: Wed Jan 28, 2004 4:10 am    Post subject: HELP! I deleted my /home directory!!! Reply with quote

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
View user's profile Send private message
DopeGhoti
Tux's lil' helper
Tux's lil' helper


Joined: 17 Jan 2004
Posts: 100
Location: Vermont, US

PostPosted: Wed Jan 28, 2004 4:30 am    Post subject: Reply with quote

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
View user's profile Send private message
ender wiggin
Tux's lil' helper
Tux's lil' helper


Joined: 08 Feb 2003
Posts: 119
Location: CO

PostPosted: Wed Jan 28, 2004 4:33 am    Post subject: Reply with quote

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
View user's profile Send private message
ender wiggin
Tux's lil' helper
Tux's lil' helper


Joined: 08 Feb 2003
Posts: 119
Location: CO

PostPosted: Wed Jan 28, 2004 4:44 am    Post subject: Reply with quote

DopeGhoti - you must type quicker than I do :D

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
View user's profile Send private message
thechosen0ne
n00b
n00b


Joined: 23 Jan 2004
Posts: 36

PostPosted: Wed Jan 28, 2004 6:01 am    Post subject: Yay! Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum