Solved

ubuntu user ssh login error 'Could not chdir to home directory permission denied'

Posted on 2010-09-23
9
2,147 Views
Last Modified: 2012-05-10
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
0
Comment
Question by:joggx
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 12

Expert Comment

by:larsrohr
ID: 33750781
Does the home directory for this user exist, and is it owned by that user?

What are the permissions on /etc/sudoers?  (ls -l /etc/sudoers)
0
 

Author Comment

by:joggx
ID: 33750850
@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
0
 
LVL 12

Expert Comment

by:larsrohr
ID: 33750873
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

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 12

Expert Comment

by:mccracky
ID: 33754959
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
0
 

Author Comment

by:joggx
ID: 33755045
@mccracky:

> Also, is the user's home directory really what you think it is?
yes it is.
0
 
LVL 12

Expert Comment

by:mccracky
ID: 33755076
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.
0
 

Author Comment

by:joggx
ID: 33759214
@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:

0
 
LVL 3

Accepted Solution

by:
rgeers earned 125 total points
ID: 33762263
This system has a serious configuration problem and can be fixed by running from a rescue cd. You then log in as root, fix the password files and restart the system. You know how to run chroot to your target os? I think perhaps ubuntu does this now automatically, but it's some time ago since i ran this.
0
 

Author Comment

by:joggx
ID: 33762842
It is a VPS and I have switched to fedora and everything works fine.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question