[SOLVED] adduser: cannot create directory /home/user
-
- Posts: 14
- Joined: 2011/10/27 06:22:07
- Contact:
[SOLVED] adduser: cannot create directory /home/user
I'm receiving this error and I've been trying to figure out how to get rid of it.
When I try to login to another account beside root I get this error.
Could not chdir to home directory /home/user : permission denied
/bin/bash: Permission denied
Thanks
When I try to login to another account beside root I get this error.
Could not chdir to home directory /home/user : permission denied
/bin/bash: Permission denied
Thanks
Re: adduser: cannot create directory /home/user
What are the permissions on /home/user? If you created the directory manually as root then it's probably owned by root and the user has no access to it - you'd need to chown -R it to the correct ownership.
-
- Posts: 14
- Joined: 2011/10/27 06:22:07
- Contact:
Re: adduser: cannot create directory /home/user
Thanks Trevor!
I have made the directory under root and I guess that the reason why I can't access it. I have set the chmod to 777 on both files but it's not
I have also tried chown -R user /home
I still seem to be getting the same errors?
I have made the directory under root and I guess that the reason why I can't access it. I have set the chmod to 777 on both files but it's not
I have also tried chown -R user /home
I still seem to be getting the same errors?
Re: adduser: cannot create directory /home/user
[quote]
I have also tried chown -R user /home
[/quote]
Ouch, that doesn't sound right. /home should be owned by root:root with permissions 755. Each user's subdirectory in /home should be owned by their userid:group. Perhaps you can post the output of
[code]
ls -la /home
ls -laZ /home
[/code]
I have also tried chown -R user /home
[/quote]
Ouch, that doesn't sound right. /home should be owned by root:root with permissions 755. Each user's subdirectory in /home should be owned by their userid:group. Perhaps you can post the output of
[code]
ls -la /home
ls -laZ /home
[/code]
-
- Posts: 14
- Joined: 2011/10/27 06:22:07
- Contact:
Re: adduser: cannot create directory /home/user
Ahh I see now.
Heres what I got for for ls-la /home I got the following.
[quote]total 16
drwxrwxrwx 3 user root 4096 October 27 03:41 .
drwx-------- 25 root admin 4096 October 27 03:40 ..
drwxrwxrwx 2 user root 4096 Oct 27 03:41 user
[/quote]
[quote]drwxrwxrwx user root .
drwx------- root admin system_u:object_r:root_t:s0 ..
drwxrwxrwx user root user
[/quote]
Heres what I got for for ls-la /home I got the following.
[quote]total 16
drwxrwxrwx 3 user root 4096 October 27 03:41 .
drwx-------- 25 root admin 4096 October 27 03:40 ..
drwxrwxrwx 2 user root 4096 Oct 27 03:41 user
[/quote]
[quote]drwxrwxrwx user root .
drwx------- root admin system_u:object_r:root_t:s0 ..
drwxrwxrwx user root user
[/quote]
Re: adduser: cannot create directory /home/user
So let's start by putting things back how they should be...
[code]
chmod 755 /home
chown root /home
chmod 755 /home/user
chown -R user:user /home/user
[/code]
From the output of your ls -laZ I am guessing that you have disabled SELinux?
For the original problem, how exactly are you logging in? Is it at a text console? Using a GUI login prompt? Or over ssh?
[code]
chmod 755 /home
chown root /home
chmod 755 /home/user
chown -R user:user /home/user
[/code]
From the output of your ls -laZ I am guessing that you have disabled SELinux?
For the original problem, how exactly are you logging in? Is it at a text console? Using a GUI login prompt? Or over ssh?
-
- Posts: 10642
- Joined: 2005/08/05 15:19:54
- Location: Northern Illinois, USA
[SOLVED] adduser: cannot create directory /home/user
drwx-------- 25 root admin 4096 October 27 03:40 ..
That is / and should be:
drwxr-xr-x 25 root root 4096 Sep 15 12:31 ..
That is / and should be:
drwxr-xr-x 25 root root 4096 Sep 15 12:31 ..
-
- Posts: 14
- Joined: 2011/10/27 06:22:07
- Contact:
Re: adduser: cannot create directory /home/user
I currently have selinux disabled.
I was logged into the kvm.
I can now copy paste exactly, and have changed the permissions to this now
# ls -la /home
total 16
drwxr-xr-x 3 root root 4096 Oct 27 10:01 .
drwx------ 25 root root 4096 Oct 27 03:40 ..
drwxr-xr-x 2 User User 4096 Oct 27 10:01 User
# ls /home
-laZ /home
drwxr-xr-x root root .
drwx------ root root system_u:object_r:root_t:s0 ..
drwxr-xr-x User User User
Thanks guys for the help!
I was logged into the kvm.
I can now copy paste exactly, and have changed the permissions to this now
# ls -la /home
total 16
drwxr-xr-x 3 root root 4096 Oct 27 10:01 .
drwx------ 25 root root 4096 Oct 27 03:40 ..
drwxr-xr-x 2 User User 4096 Oct 27 10:01 User
# ls /home
-laZ /home
drwxr-xr-x root root .
drwx------ root root system_u:object_r:root_t:s0 ..
drwxr-xr-x User User User
Thanks guys for the help!
-
- Posts: 14
- Joined: 2011/10/27 06:22:07
- Contact:
Re: adduser: cannot create directory /home/user
got it to work!
It was my directory /
I set the chmod to 755 and it worked!
Thanks guys for all the help
It was my directory /
I set the chmod to 755 and it worked!
Thanks guys for all the help
-
- Retired Moderator
- Posts: 18276
- Joined: 2006/12/13 20:15:34
- Location: Tidewater, Virginia, North America
- Contact:
Re: [SOLVED] adduser: cannot create directory /home/user
Thanks for reporting back. Marking this thread [SOLVED] for posterity.