Make your ssh connection easier

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:)

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 ." data-share-imageurl="">

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.