Member_2_5139014
asked on
ubuntu user ssh login error 'Could not chdir to home directory permission denied'
On Ubuntu I could ssh to log in as root but after creating a user I can't log in as that user and get the following error:
Could not chdir to home directory permission denied
Another strange thing is sudo is not possible too:
sudo: can't open /etc/sudoers: Permission denied
Could not chdir to home directory permission denied
Another strange thing is sudo is not possible too:
sudo: can't open /etc/sudoers: Permission denied
ASKER
@larsrohr
Yes the home directory for this user exists, chmod 755, group and owner are all the user itself.
ls -l /etc/sudoers
-r--r----- 1 root root 481 2009-09-20 18:37 /etc/sudoers
Yes the home directory for this user exists, chmod 755, group and owner are all the user itself.
ls -l /etc/sudoers
-r--r----- 1 root root 481 2009-09-20 18:37 /etc/sudoers
Have you changed any directory permissions?
The following should especially be checked:
ls -ld /
ls -ld /etc /usr /usr/bin /usr/sbin
and any directories in the path to the user in question, e.g.:
ls -ld /home /home/user
The following should especially be checked:
ls -ld /
ls -ld /etc /usr /usr/bin /usr/sbin
and any directories in the path to the user in question, e.g.:
ls -ld /home /home/user
Also, is the user's home directory really what you think it is?
The second to the last item of this shows what the system thinks is the home directory:
grep <username> /etc/passwd
The second to the last item of this shows what the system thinks is the home directory:
grep <username> /etc/passwd
ASKER
@mccracky:
> Also, is the user's home directory really what you think it is?
yes it is.
> Also, is the user's home directory really what you think it is?
yes it is.
Oh, I think it has to do with the way ubuntu is set up. IIRC, ubuntu only has the first user enabled to use sudo as an admin user. By default all other users are created without admin rights. Check what groups the new user is in in the /etc/group file.
ASKER
@mccracky:
the problem is event under root I can't run sudo, and get the permission error.
the /etc/group has the top line:
root:x:0:
the problem is event under root I can't run sudo, and get the permission error.
the /etc/group has the top line:
root:x:0:
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It is a VPS and I have switched to fedora and everything works fine.
What are the permissions on /etc/sudoers? (ls -l /etc/sudoers)