1

One of my servers is acting very strange. I've just set up private public rsa authorization for logging in to my two servers, using putty on my end. It works fine for one of them, so putty or the keys isn't the problem.

When I try to log on using the private key I get an Server refused our key error and a password prompt. If I then login, and try to log on another time with in a new SSH session it logs in fine. So I have a couple of questions. Can it matter that I have a session open? And that this behaviour is considered normal, and it's something wrong with my setup.

What could possibly be wrong with my system to explain this behaviour. It seems that the server can't run some services if there isn't a user logged on, but it runs an apache server and torrentflux fine. Though I am reminded that I had similar issues with another torrent client (rtorrent I think), that would stop downloading if I wasn't logged on.

Update

I think the problem is a encrypted home directory. So I'll have to investigate how to configure it to let me use rsa private authorization. I have sneaking suspision that this might be the cause of more weird quirks with the system, like the PWD resetting for emacs in a screen session if I log out after detatching.

Update

It was the encrypted file system that was the problem, and I followed the instruction in the Troubleshooting section here to fix the problem. But now my home directory won't mount unless I do ecryptfs-mount-private which is a pain. Maybe I should just get rid of the encrypted home dir.

2
  • 2
    Do you have your home directory mounted from network or using some kind of encryption/loop mount/compression? If you're using PAM, make sure the relevant modules are correctly configured.
    – billc.cn
    Aug 2, 2011 at 20:32
  • the home directory is encrypted
    – liei
    Aug 2, 2011 at 21:47

2 Answers 2

1

The encryption key is probably encrypted using your password, so you must supply your password at some stage.

If this is inconvenient, you can always use some tricks to keep your session alive so the encrypted home folder is not automatically unmounted for you. For example, you can log in via the console and lock screen. Or you can log in with a password and start a Screen session.

1
  • Setting an alternative location should fix this. AuthorizedKeysFile /etc/ssh/%u/authorized_keys
    – hayalci
    Dec 25, 2012 at 0:08
0

Go to the console and stop the sshd. Then start it in forground with debug-mode enabled. Then reconnect with putty. You should see the problem more clearly now. If not - post the output here...

1
  • I don't have physical access to the server. But I'm now pretty sure that it's the encrypted home directory that is the problem. I don't have a encrypted home directory on the other server.
    – liei
    Aug 2, 2011 at 21:53

You must log in to answer this question.

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