Make your ssh connection easier
Submitted by Šimon Berka on Tue, 07/10/2012 - 21:40
Today I want to share simple advice with you. For few weeks I have to make a ssh connection to my server with some parameters.
It' pretty strange to write this command every day:
ssh user1@server.com -o PubkeyAuthentication=no -p 58694
Now you have few ways how to simplify this routine. Either you can create alias - by the alias command, or permanently in .bashrc file or the better way, use the ssh config file:
Create new file ~/.ssh/config and inside it something like this pattern:
Host shortservername Hostname serveraddress.com User loginusername Port portnumber other parameters
When we use the one-line ssh command, the config file is going to look like this:
Host myserver Hostname server.com User user1 Port 58694 PubkeyAuthentication No
And when I want to make connectionm just use this command:
ssh myserver
I hope this will help:)
Add new comment