Now, instead of writing a long command like this: ssh -p 1500 You can add all this information in the following manner in your ~/.ssh/config file: Host website
To harden SSH security, you use port 1500 instead of the default SSH port 22. Your username is Alice and the server is used for hosting your website. Let’s say you connect to a server with IP 275.128.172.46. Let me show you an example of the syntax which you should follow. Now that you have the SSH config file, you can edit it using Vim or Nano. You can easily create this file using the touch command like this: touch ~/.ssh/config Step 2: Add an SSH profile in the config file Your config is also stored here.Īt least on Ubuntu, the SSH config file is not created by default. This direct contains your public key, private key a known_hosts file.
MAC SSH SERVER CONFIG INSTALL
When you install SSH, you’ll have a ~/.ssh directory created automatically. So, if you connect to multiple remote systems via SSH, creating SSH profiles will be a good move to save your time. There is no limit to such profiles and you may add as many as possible. The SSH config file allows you to create different profiles for different host configurations. Using SSH config file for easily connecting to remote servers Of course, I can open my dashboards on Linode, UpCloud, DigitalOcean and Google Cloud to get the IP or keep a list on my local system.Ī better and easier way is to use SSH config file. Even if I can find the SSH commands from the history, it is difficult to guess which IP belongs to which server. Now keeping a track of these servers is not easy. Some are production servers and some are test servers. I have around ten servers that I connect to from time to time. Even if you don’t remember the server’s IP address, you can perform a reverse search to the history using the famous terminal keyboard shortcut Ctrl+R and find the SSH command you used in the past.īut things get complicated when you have several servers to manage. Now this is all plain and simple if you just have one server. You may specify the port as well if you want. This connects to the default SSH port 22. All you need to do is to use a command like this: ssh _IP Using SSH to connect to remote system is simple. If you are even a tad bit familiar with SSH, you know that you can use it to connect to remote Linux systems.