What is SSH and How to Connect to your Server Via SSH? How to Generate and Import New Keys?
Posted by Allura on 13 08 2019.
The SSH (secure shell) network protocol allows in connecting with another web server with the help of a command line interface (CLI) over the internet. This network protocol can be used in managing one’s server, configure CGI scripts, and perform various other tasks.
Modern operating systems like, MacOS® and Linux distributions, has SSH. If Microsoft Windows® is used in connecting with the server, you must use an SSH client like PuTTY, to log in to the server.
A lot of Unix-based operating systems have standardized commands. To know more, read our One-Serve website documentation. Also note that all hosting providers does not allow shell access.
How to Connect to your Server via SSH?
With the Help of PuTTY
- Start by downloading and installing the PuTTY client.
- Then open the client from the Windows Start menu.
- In the Host Name (or IP address) text box, enter the hostname or IP address of the server, from the Session interface.
- In the Port text box, you need to enter the Port number. While doing this, make sure in selecting the SSH
- Click on Open option.
- Then enter root as the login name.
- Lastly, enter the root password.
With The Help Of PuTTY And A Private Key
- Firstly, open the client from the Windows Start menu.
- Then navigate to the PuTTY Key Generator interface.
- Click on Generate option available under the Actions heading. PuTTY helps in generating the key and displaying the result under the Key menu.
- In the .ssh/authorized_keys file, copy the public key and paste it.
- Then you need to enter a passphrase in the Key passphrase and Confirm passphrase text boxes.
- Click on Save private key and accordingly save the key as a .ppk file. Make sure to save as .ppk file only.
- Select your preferred authorization session from the Saved Sessions menu and click on Load, available in the Sessions interface.
- Under the SSH category, you need to navigate to the Auth interface.
- Click on Browse and select the private key file to upload. Then click on Open option.
- Finally, navigate to cPanel’s Manage SSH Keys interface ( Home >> Security >> SSH Access >> Manage SSH Keys) and import the server’s keys.
Connect MacOS Or Linux Server Via SSH
- Start by opening a terminal session.
- Next, run this following command:
ssh -p port user@IP
- port refers to the port number.
- user refers to your username.
- IP refers to your IP address.
How to Generate and Import New Keys?
Steps to Generate a New Key
- Click on Generate a New Key.
- Enter the key name in the Key Name (value defaulting to id_rsa): text box, for using a key name of your choice (custom key name).
- In the proper text boxes, enter and confirm the new password.
- You can select the desired key type between these two: DSA keys for quicker key generation and signing times, and, RSA keys for quicker verification times.
- Then select the desired key size.
- Click on Generate Key and the interface will display the place where the key is saved.
Steps to Import an Existing Key
- Click on Import Key.
- Enter the key name in the Choose a name for this key (defaults to id_dsa) text box for using a key name of your choice (custom).
- Then paste the public and private keys in the specific text boxes.
- Finally, click on Import.
All information about SSH is outlined in this review.