Put this into your $HOME/.ssh/config
:
Host somealias
HostName example.com
Port 22
User myuser
You can then type ssh somealias
and it will actually do a ssh -p 22 myuser@example.com
Domanda
I have an account on my college server and I access it on linux terminal using
ssh {username}@{hostname}.com
I was Wondering if there is a way to access this account only by typing.
ssh {hostname}
Soluzione
Put this into your $HOME/.ssh/config
:
Host somealias
HostName example.com
Port 22
User myuser
You can then type ssh somealias
and it will actually do a ssh -p 22 myuser@example.com
Altri suggerimenti
Like the comments say: Yes, if username
is the same on both client and server