2

I have a strange issue with my ssh server. If I start my home server, then login through ubuntu with my account (I only have one account) everything works fine, I have no problem to access the ssh server launched on this server with my other computer (OSX). But, if I start my home server and do not log in at start (the server stay with "login:") I have the following troubles :

  • The RSA auth with public/private key does not work, I have to type my password manually
  • If I launch a detached processus (using a final &) this process is paused when I end the ssh link. If I connect again the process is running again.

My home server (Ubuntu) config is :

SSH: OpenSSH_5.5p1 Debian-6, OpenSSL 0.9.8o 01 Jun 2010
OS : Linux XXXX 2.6.32-28-server #55-Ubuntu SMP Mon Jan 10 23:57:16 UTC 2011 x86_64 GNU/Linux

I access it using my workstation (OSX) :

SSH: OpenSSH_5.2p1, OpenSSL 0.9.8r 8 Feb 2011
OS : Darwin MacBook-de-kheraud.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386

Do you have an idea where it comes from ? Is there a way to have SSH working as usual even if there is no logged user on the server ?

1
  • That is indeed weird - SSH and local logins should be quite independent from each other. Aug 25, 2011 at 15:57

1 Answer 1

3

Is your home drive on the Ubuntu server encrypted?

If so then it is decrypted when you log in to the local account. When you try and ssh in before logging in locally then ssh can not read your ~username/.ssh/authorized_keys file and will ask for your password.

A solution would be to change the location that ssh looks for authorized_keys. As root you can edit the /etc/ssh/sshd_config file and change the AuthorizedKeysFile line.

For example if you change it to -

AuthorizedKeysFile  /etc/ssh/authorized_keys.%u

then copy your ~username/.ssh/authorized_keys to /etc/ssh/authorized_keys.username. ssh will be able to read it without logging into the machine locally.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .