I have created a public/private key pair and logged into my server with it. I have also copied it to the server under a user. It asked me for the password when logging in the first time but it doesn't ask me for said password anymore. I am on Ubuntu and I'm wondering if the ssh process automatically adds keys to the agent and if so, how do you control how long those keys are in the agent?
- Have you read the ssh-agent man page?dirdi– dirdi2019-10-12 18:35:21 +00:00Commented Oct 12, 2019 at 18:35
- Is the user's home directory on the server encrypted?Kenster– Kenster2019-10-12 19:02:46 +00:00Commented Oct 12, 2019 at 19:02
- @dirdi The man page says "The agent initially does not have any private keys. Keys are added using ssh-add(1). When executed without arguments, ssh-add(1) adds the files ~/.ssh/id_rsa, ~/.ssh/id_dsa and ~/.ssh/identity. If the identity has a passphrase, ssh-add(1) asks for the passphrase (using a small X11 application if running under X11, or from the terminal if running without X). It then sends the identity to the agent." "Later ssh(1) looks at these variables and uses them to establish a connection to the agent. " However, I never add an SSH key with ssh-add, I connect directly to ssh [1]Whiteclaws– Whiteclaws2019-10-12 19:13:16 +00:00Commented Oct 12, 2019 at 19:13
- And through said connection, I am asked a password for the private key, which is why I am asking this question... Why am I not asked for a password every time I log in and only once even though I never added a key to the ssh agent?Whiteclaws– Whiteclaws2019-10-12 19:14:34 +00:00Commented Oct 12, 2019 at 19:14
Add a comment |