software:ssh_config
Differences
This shows you the differences between two versions of the page.
| software:ssh_config [2026/07/27 08:07] – created solar | software:ssh_config [2026/07/27 08:25] (current) – solar | ||
|---|---|---|---|
| Line 29: | Line 29: | ||
| Instead of having to write '' | Instead of having to write '' | ||
| + | |||
| + | ==== ssh-agent ==== | ||
| + | |||
| + | One thing you cannot -- and indeed should not -- write into a config file is the pass phrase for your private key. Neither should you use a private key //without// a pass phrase. Instead, you should set up a key agent: A process that takes your passphrase //once//, unlocks your private key with it, and keeps it available until you log out again. | ||
| + | |||
| + | SSH comes with one such key agent included -- '' | ||
| + | |||
| + | < | ||
| + | start_agent() { | ||
| + | mkdir -p " | ||
| + | ssh-agent -s > " | ||
| + | chmod 600 " | ||
| + | . " | ||
| + | } | ||
| + | |||
| + | agent_is_usable() { | ||
| + | [ -n " | ||
| + | kill -0 " | ||
| + | [ -n " | ||
| + | [ -S " | ||
| + | } | ||
| + | |||
| + | if [ -f " | ||
| + | . " | ||
| + | fi | ||
| + | |||
| + | if ! agent_is_usable; | ||
| + | start_agent | ||
| + | fi | ||
| + | </ | ||
| + | |||
| + | Now, when you need SSH the first time, call '' | ||
| + | |||
| + | Many passkey managers have some kind of SSH agent integration, | ||
| ==== Bottom Line ==== | ==== Bottom Line ==== | ||
| If you have set up your SSH environment correctly, copying a file from local to remote becomes as easy as '' | If you have set up your SSH environment correctly, copying a file from local to remote becomes as easy as '' | ||
software/ssh_config.txt · Last modified: by solar
