I want to set an alias so that I can swiftly log in to one of my workstations. For example, I must enter
ssh [email protected]
to log in to one of my machines. Sometimes, the hostname could be c1232-node2
or c1232-node3
, but the domain name would always be example.com.
I want to add the alias permanently in my .zshrc
file so that I need not set it every time I open the terminal.
I did my research, and I was successful using a function such as below:
ssh_node() { ssh root@"$1".example.com; }
But when I add this function into my .zshrc
and run the source
command on it, it complains and doesn't accept the function.
Thanks in advance for the help!