I am using key based authentication for ssh. When ever i try to login into the system it doesn't ask me for public key. It simply logs in, i just want to logout from this public key authentication. And when ever i need i will enable it. Can some one say me the way to logout from Public Key authentication. And How to set timeout for this public key authentication? Thanks in advance.
2 Answers
If from command line you can see your identity with
ssh-add -l
then you can remove it (i.e. make the agent to forget it), with
ssh-add -D
-
-
@karthick87: you can use
ssh-add -t number-of-secs
. It will ask for passphrase.– enzotibDec 8, 2011 at 8:43 -
-
There is not timeout (or infinite timeout). The man page of
ssh-add
say it is configurable, but cannot found where.– enzotibDec 8, 2011 at 9:51 -
For the traditional
ssh-agent
, it is possible to set a default time out through a command line switch. You'll probably find thatssh-add
is talking tognome-keyring
though, and I don't think it has the facility to set a default time out for keys. Dec 8, 2011 at 10:25
Do you mean you want a normal login/logout method? If yes, then remove the key in the remote machine. I think its in /home/$USER/.ssh/authorized_keys then restart ssh daemon. Please let me know if that is correct.
-
No you are wrong. I just want to logout from the public authentication. So that after i close my terminal and if i open again, it should prompt for public key. Dec 8, 2011 at 7:47