Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I set up ssh with keys and it was working fine for a while. Ive just had a bit of a clean up and now some seriously weird things are happening, disabling terminal access from my server

As I say SFTP is working, asks me for my passphrase, enter passphrase, then get access

When I use ssh over terminal it asks for passphrase, i enter the same passphrase and it says permission denied?

I am connecting to ubuntu server with a centos client.

Ive also tried using windows putty as the client, but again it denies my passphrase.

How come it works on my centos client through sftp? is the passphrase cached or something?

I use the same passphrase for everything, so I am wondering why terminal access is completely ignoring my passphrase.

I have access to all the files, so is there any way I can just turn on passwords in ssh conf and then reboot the server to restart ssh (since i cannot reboot it from terminal)

nautlius asks me for keyring and i enter my passphrase and it works for sftp, how come terminal access has stopped working in the same way?

Any help is much much much appreciated.

Cheers

ke

share|improve this question
add comment

2 Answers

Check this article:

Couple of things to check/try:

  • For public key login, run:

    chmod 600 ~/.ssh/*
    

    on both client and server. This is a quick way, check e.g. this article: http://www.noah.org/wiki/SSH_public_keys (section "Permission problems with SSH ") for a list of correct permssions.

  • For password login, check that this line:

    PasswordAuthentication yes
    

    is present and not commented out (# in front of it) in your /etc/ssh/sshd_config. I would suggest turning it off later when you setup public key authentication.

  • Check that you using the correct user/server when logging in:

    ssh correctuser@correctserver
    

    It can happen that you did some changes that need this line changed.

  • Check the logs in /var/log/auth.log. Check the first link for more information, section "Log More Information". You should see it recording your attempts and give you more info about what might be the issue

  • Use ssh -v to log verbosely on the client, too.c

  • You can run sshd in debug mode:

    sudo /etc/init.d/ssh stop
    sudo /usr/sbin/sshd -d
    

    and monitor the output.

Rembember to restart the server with sudo /etc/init.d/ssh restart after config changes.

I suggest that you take a look e.g. at the pages I provided to see how to properly configure the server to your needs. You can start from here for example:

share|improve this answer
    
it has been working fine for a while. it seems that I have stupidly forgotten my passphrase, maybe nautlius has cached the passphrase and is asking me for my root login pass? maybe thats why i can access through nautilus sftp and not anything else? you think its a good idea to change PasswordAuthentication to yes to gain terminal access to the server again? I can then reboot the server from my cp, that should restart sshd no? –  Ke. Dec 5 '10 at 13:49
    
If you forgot your key passphrase, then that will probably be the only way. Again, do read the above articles to configure it properly (even after the intervention). –  icyrock.com Dec 5 '10 at 14:07
add comment

Have you checked so the user actually has a shell (check the passwd file)? If the shell is set to /bin/false or similar you will not be able to log in over ssh.

share|improve this answer
    
it is set to /bin/bash so should be working? nautlius asks me for keyring and i enter my passphrase and it works for sftp, how come terminal access has stopped working in the same way? –  Ke. Dec 5 '10 at 13:43
    
Is this on the server? That's where you have to check so you have the shell set. The shell might also be set to something like rssh (restricted ssh), which can prevent login. –  pehrs Dec 6 '10 at 15:11
add comment

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.