On a daily basis, I interact with 10s of productions servers which do not, and should not have a home directory for my personal user.
Every SSH session is met with the same error message:
Could not chdir to home directory /home/Me: No such file or directory
Killed by signal 1.
Is there a way to prevent SSH from trying to cd me into /home/Me, or is there any other way to surpress this message?
sshd
daemon expected to know in which directory you should land upon connecting? Have a look atChrootDirectory
but it needs various setup. Or something like that to adapt :ForceCommand bash -c "cd /tmp; bash --login"
(ugly, and not sure that works), otherwise you need to look at PAM and speciallypam_mkhomedir
that you will need to plug from sshd PAM config./
pam_mkhomedir
it creates the home directory automatically upon login, if missing. And you can centralize authentication through some LDAP server so no need to have you as user in/etc/passwd
. Or it can be in the VM template. Otherwise you could always recompile your own ssh that does 'chdir /' but I am not sure it is a good idea, just try ForceCommand or even better proper user management with PAM, this will be simpler...