Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 ?

share|improve this question

migrated from stackoverflow.com Aug 25 '11 at 16:27

This question came from our site for professional and enthusiast programmers.

    
That is indeed weird - SSH and local logins should be quite independent from each other. –  Piskvor Aug 25 '11 at 15:57

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.