Sample Header Ad - 728x90

How can I run ssh-add automatically, without a password prompt?

360 votes
24 answers
546740 views
I want to communicate between several computers on my network (static Ethernet), through SSH. In order to do that I need to run [ssh-add](https://man.archlinux.org/man/ssh-add.1.en) every time I log in on a specific machine. What can I do so it's set up once and it doesn't ask me for the passphrase every time I log in or reboot my machine? I know that there is a way where you add some lines to the bash_profile file, but I still need to type the password every time I reboot/log in to a specific machine. if [ -z "$SSH_AUTH_SOCK" ] ; then eval ssh-agent -s ssh-add fi
Asked by zdun8 (3767 rep)
Sep 16, 2013, 10:31 AM
Last activity: Jan 27, 2025, 08:01 PM