Auto Fill Upward Inward Ssh Customer Parameters

I frequently ssh to dissimilar servers, both at last too at home. Often, the Linux trouble organisation human relationship mention is dissimilar according to which server I'm logging in. Also, unopen to servers are gear upwards to permit ssh login through a dissimilar port than the default port 22. For instance, to login to 123.123.123.123, I ask to type all this in:

 # ssh -p 2222 admin_2@123.123.123.123 

All of this tin popular off human unmanageable rather quickly.

Luckily, I tin gear upwards the ssh customer such that it fills inwards ssh login parameters such every bit port pose out too user name.

I exactly type ssh followed yesteryear the IP address or hostname of the estimator I desire to login. ssh fills inwards the correct port # too user mention according to the IP or hostname.

 # ssh 123.123.123.123 admin_2@123.123.123.123's password:  

To laid it up, insert the next lines into your personal ssh customer configuration file, /.ssh/config.

 Host 123.123.123.123    User admin_2    Port 2222 

Note that you lot should edit the configuration file on the ssh customer computer. In other words, the setup is on the source estimator from which you lot initiate the ssh request, non the target server that you lot desire to login to.

Alternatively, you lot tin brand the modify for all users. Insert the same lines into the system-wide ssh customer configuration file. For Debian-based distributions, the file is /etc/ssh/ssh_config. You volition ask rootage access to edit that file.

After you lot brand the edits, whatsoever novel ssh customer login volition convey the port too user mention filled inwards automatically.

In improver to ssh, programs such every bit scp too sftp volition every bit good produce goodness from these settings.

 # scp afile.txt  123.123.123.123: admin_2@123.123.123.123's password:  afile.txt                                  100%  198     0.2KB/s   00:00     

If you lot similar this article, you lot may detect this article interesting:

How to disable ssh host primal checking

Berlangganan update artikel terbaru via email:

0 Response to "Auto Fill Upward Inward Ssh Customer Parameters"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel