3

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 2

4

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
5
  • Is it possible to set a automatic timeout?
    – karthick87
    Dec 8, 2011 at 8:32
  • @karthick87: you can use ssh-add -t number-of-secs. It will ask for passphrase.
    – enzotib
    Dec 8, 2011 at 8:43
  • What is the default timeout?
    – karthick87
    Dec 8, 2011 at 9:42
  • There is not timeout (or infinite timeout). The man page of ssh-add say it is configurable, but cannot found where.
    – enzotib
    Dec 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 that ssh-add is talking to gnome-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
0

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.

1
  • 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.
    – karthick87
    Dec 8, 2011 at 7:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .