by malikNF · 2y ago · 0 comments
On your local machine under ~/.ssh/config you can add something like
#PERSONAL
Host vpn-us
HostName 1.2.3.4
User my_fun_username
Port 1212
now you can ssh usingssh vpn-us
(above is the same as the following command --> ssh my_fun_username@1.2.3.4 -p1212)
$ cat .ssh/config
# Fictitious example
Include work.config
Include personal.config
$
https://man7.org/linux/man-pages/man5/ssh_config.5.html $ grep '^Host' .ssh/<config file> | awk '{print $2}' | while read hst; do ssh $hst '<remote command>' 2> /dev/null < /dev/null; done