I have a script that starts my vagrant machine, opens up multiple terminals and connects to the vagrant machine via ssh in every newly opened terminal. My problem is that I need about five terminals, and I don't want to type in the password for each terminal manually. Is there a way to get prompted for the password only once in the main terminal, and use the same password for the ssh command?
#!/bin/bash
cd /home/kkri/public_html/freitag/vagrant
vagrant up
for run in $(seq 1 $1)
do
gnome-terminal --window-with-profile=dark -e "ssh vagrant@localhost -p 2222" --$
done
gnome-terminal --window-with-profile=git
clear
echo "~~~ Have fun! ~~~"
scp
more comfortable without compromising security. The following link provides a HowTo that should be applicable to your remote system, too. If you trust your environment enough (firewalled intranet) you can even generate a key without passphrase. linode.com/docs/security/use-public-key-authentication-with-ssh – Murphy Sep 5 '16 at 9:35cssh
andpssh
(Cluster SSH respectively Parallel SSH) – Valentin Bajrami Sep 5 '16 at 9:36ssh vagrant@localhost -p 2222
rather thanvagrant ssh
? The latter is better as it will correct the port if you have more then one vagrant box running. – Michael Daffin Sep 5 '16 at 9:53vagrant ssh
!! – Boris the Spider Sep 5 '16 at 11:08