Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to check if authorization authentication with keys is available without permission to read ssdh_config ?

share|improve this question
I just wanted to know if it's possible without password (actually, I was not aware about the DSA keys at the moment of asking this question). Thank for your input anyway :) – Wiktor May 10 '13 at 14:02
Would you mind rephrasing your question? It's not entirely clear that you weren't asking about RSA at all. I'd completely remove that reference. I can do it if you like. LMK. – slm May 10 '13 at 14:03
Sure thing. Done. – Wiktor May 10 '13 at 14:05
up vote 3 down vote accepted

If the server is running and reachable:

ssh -vvv user@host

results in such lines:

Authentications that can continue: publickey
Next authentication method: publickey

Edit 1

Or limit it to the relevant output:

ssh -vvv user@host 2>&1 | grep "Next authentication method:"
share|improve this answer
I'm afraid there is no such line. Just: debug1: Host '***' is known and matches the RSA host key. debug1: Found key in /home/wiktor/.ssh/known_hosts:1 debug1: ssh_rsa_verify: signature correct debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: Roaming not allowed by server debug1: SSH2_MSG_SERVICE_REQUEST sent debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: password debug1: Next authentication method: password – Wiktor May 10 '13 at 13:17
Did you tried with -vvv? it is better to update this kind of information in the question, so it is easier to read and easier to find – RSFalcon7 May 10 '13 at 13:53
@RSFalcon7: yes, I have. I think this option is just off on this server. I only get info about password authentication. – Wiktor May 10 '13 at 14:00

You can connect to the server allowing only public keys (and exiting immediately) with this command:

user@box ~ $ ssh -o PasswordAuthentication=no HOSTNAME exit &>/dev/null
user@box ~ $ test $? == 0 && echo can connect || echo cannot connect
can connect
user@box ~ $ 

After the main command, you can check the result code to see if you can connect without password or not.

share|improve this answer

Your Answer


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.