ssh wrong home path

Asked by ReimarBauer

some of my users are having a homedir below another dir in home e.g.

/home/user/NAME

The user dir is shared by an nfs mount to several boxes.

It seems not to possible to connect bugfree by ssh from such a user to another box.

The user can login by password. But then he is not in his homedir. He is in /

If one calls ssh-copy-id he gets:
mkdir: cannot create directory `.ssh': Permission denied
/bin/bash: .ssh/authorized_keys: No such file or directory

For a user below /home e.g. /home/NAME everything works as supposed

cheers
Reimar

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu openssh Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

This question was originally filed as bug #392124.

This question was reopened

Revision history for this message
ulul (ulul) said :
#1

Hi,
on the other box (the one they're logging to) is the homedir correctly set in /etc/passwd and not overwritten (HOME var) in .bashrc or .profile ?

ulul

Revision history for this message
ReimarBauer (reimarbauer) said :
#2

local login works on every machine for every user and pathes are correct. nis client config was done by
https://help.ubuntu.com/community/SettingUpNISHowTo

lastlines of /etc/passwd

fetchmail:x:117:65534::/var/lib/fetchmail:/bin/false
+::::::

the home var is not overwritten in the users .bashrc or .profile
(me thinks that the home dir isn't reached at all)

Revision history for this message
ulul (ulul) said :
#3

Sorry for asking annoying questions but I'm new at bug triaging and I want to be sure that I get the whole picture.

If I get you correctly your users are declared in NIS which means that they must have the same homedirs on every box they access. Do your users with /home/user/NAME have that dir (with on every box ?

The question I should have asked first : is the login correct on the console ? with telnet ? and rlogin ?
By correct I mean that they find their homedir when logging by these means.

Last thing : could you give me the OS and ssh versions on the boxes ?

Revision history for this message
ulul (ulul) said :
#4

(with
means (with the correct permissions) :-)

Revision history for this message
ReimarBauer (reimarbauer) said :
#5

>Sorry for asking annoying questions but I'm new at bug triaging and I want to be sure that I get the whole picture.
np

>If I get you correctly your users are declared in NIS which means that they must have the same homedirs on every >box they access. Do your users with /home/user/NAME have that dir (with the correct permissions)

yes, it is mounted by nfs

>The question I should have asked first : is the login correct on the console ? with telnet ? and rlogin ?
>By correct I mean that they find their homedir when logging by these means.

yes, it is. (tested on the console others can't be checked)

>Last thing : could you give me the OS and ssh versions on the boxes ?

kubuntu 9.0.4

ssh -V localhost
OpenSSH_5.1p1 Debian-5ubuntu1, OpenSSL 0.9.8g 19 Oct 2007

Revision history for this message
ReimarBauer (reimarbauer) said :
#6

Can this be dependent to the recent kernel update? Or some other on the path from 9.0.4 to yet?
I am sure it has worked sometime before.

Revision history for this message
ulul (ulul) said :
#7

Hi,
I tried to recreate an environment as close to yours as possible.
One virtual box acting as a NIS and NFS server (for the homedir)
Two boxes (also virtual, I don't own a lab :-) ), one ubuntu 9.0.4 one kubuntu 9.0.4
Homedir under /home/user/user1

Absolutely no problem to log on the other box (or do a ssh-copy-id) from the kubuntu one whether it be after a fresh install or after applying the hundred or so patches available (so my answer to your last question would be a no).

I really think that your problem comes from elsewhere... a mount problem most likely.

Would you agree ton convert this into a question and file another bug once you're sure this comes from ssh (or any other package) ?
Though I'm still OK to try and understand your problem.

Revision history for this message
ReimarBauer (reimarbauer) said :
#8

agreed

After ep I can do some more tests with some more installations.

cheers
Reimar

Revision history for this message
ulul (ulul) said :
#9

Unable to recreate.
ssh doesn't seem to be the root cause.
More investigation will be performed by the reporter.

Revision history for this message
ReimarBauer (reimarbauer) said :
#10

It looks like root cause is lsh-server

dpkg-reconfigure openssh-server
 * Restarting OpenBSD Secure Shell server sshd [ OK ]
 * OpenBSD Secure Shell server not in use (/etc/ssh/sshd_not_to_be_run)

dpkg -r lsh-server
dpkg-reconfigure openssh-server

solves this problem for me.

The more interesting question is now if this is a common behaviour or an unwanted feature for lsh-server.

Revision history for this message
ReimarBauer (reimarbauer) said :
#11
Revision history for this message
Launchpad Janitor (janitor) said :
#12

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Magnus Holmgren (holmgren) said :
#13

lshd gets the home directory by calling getpwnam(3), so it should work with NIS, but I haven't tried myself. It won't use PAM for authentication though, unless you edit /etc/init.d/lsh-server and add --password-helper=/usr/sbin/lsh-pam-checkpw to the command lines. I should fix that.