ssh authorized_keys command= does not work
Hi Folks,
On the internet there are numerous articles and forums topics talking about adding a line like: Code:
command="/usr/bin/ls" <ssh-key-here> Code:
$HOME/.ssh/authorized_keys Well it didn't! So I can ssh from my client to the server when my authorized_keys file is like: Code:
<ssh-key-here> Code:
command="/usr/bin/ls" <ssh-key-here> Code:
server.address.com: Permission denied (publickey,gssapi-keyex,gssapi-with-mic). Please help. Thanks in advance. |
Something is obviously wrong with how you are prepending the command="..." part. For example, you might have copy-pasted smart quotes from a tutorial or guide instead of using proper ASCII quotes.
But it is hard to guess without more information. Do you have access to the server such that you can read the logs made by sshd? Or, better yet, can you temporarily run a more verbose instance and capture the results to a file as you try connecting with the defective authorized_keys file? e.g. Code:
/usr/sbin/sshd -p 2022 -d -d -E /tmp/ssh.log |
How did you edit the file? Are the authorized_keys file permissions still -rw------ and owned by your user?
|
Quote:
The file permissions are correct. Because when I remove the command= part from the beginning, everything works. So any other ideas? |
Quote:
Code:
Bad options in /home/ec2-user/.ssh/authorized_keys file, line 3: command=ls Code:
command="/usr/bin/echo 'No commands allowed'" <ssh key here> |
All times are GMT -5. The time now is 11:39 AM. |