익명 12:00

When using SSH with a server, does it remember that I used my key? [closed]

When using SSH with a server, does it remember that I used my key? [closed]

I am trying to set one up on an old laptop of mine as a server. But the main issue that I'm having is that I don't know if SSH is working or not.

I set up the keys all right, I used a pretty recent tutorial and everything looks fine.

When I SSH into the server it only prompts for the password and not the key, is this normal?

This is what I do:

ssh user@ip-address
user@ip-address's password:

I feel weird that I am not being prompted for anything key related, does this mean that it is working, or if I did something wrong? Sorry if this is a dumb question, I looked everywhere and couldn't find an answer.



Top Answer/Comment:
ssh user@ip-address
user@ip-address's password:

I feel weird that I am not being prompted for anything key related, does this mean that it is working, or if I did something wrong?

Not working as intended.

You did something wrong.


That message means that you have not quite got ssh and sshd configured correctly, it is not working the way you seem to want.

As others said, looking at the sshd logs and/or using ssh-v should tell you what is happening.

To aid in diagnosis, you can force ssh to avoid offering password based authentication by using ssh -o "PasswordAuthentication no" .... If you want this option permanently set, you can set it in the ssh configuration file.


I would open an SSH session and keep that open while editing and then loading the sshd configuration. I would save a copy of the sshd configuration file then change the sshd configuration to disallow password authentication (set PasswordAuthenticatiuon no). Then I would try opening a second ssh session without closing the first.

The reason for keeping the first ssh session open is so that you don't lock yourself out accidentally. You can always reinstate the good/working sshd configuration from the first session.

To get sshd to reload its config without dropping existing connections I would first try sending a HUP signal to the oldest sshd process (something like pkill -HUP -o sshd).

상단 광고의 [X] 버튼을 누르면 내용이 보입니다