Difference between revisions of "SSH"
(→Configuring alternate SSH port for your VPS) |
|||
(11 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
==SSH== | ==SSH== | ||
The dedicated IP and port for SSH access on Linux VPS servers will be included in the email with server details. Alternatively we have an alternate port which can be used for SSH however this will need to be configured. Please email support for the alternate port number and follow the steps below. | The dedicated IP and port for SSH access on Linux VPS servers will be included in the email with server details. Alternatively we have an alternate port which can be used for SSH however this will need to be configured. Please email support for the alternate port number and follow the steps below. | ||
− | |||
− | |||
− | |||
− | |||
==Configuring alternate SSH port for your VPS== | ==Configuring alternate SSH port for your VPS== | ||
Line 30: | Line 26: | ||
##*If you get a connection failed, check the /etc/ssh/sshd_config file for syntax errors and correct. Run the command "''service sshd restart''" <sub>(without quotes)</sub> after making any changes to the sshd_config file. | ##*If you get a connection failed, check the /etc/ssh/sshd_config file for syntax errors and correct. Run the command "''service sshd restart''" <sub>(without quotes)</sub> after making any changes to the sshd_config file. | ||
− | == | + | ==Connecting to your server with a SSH key== |
+ | |||
+ | To connect via SSH you'll first need to download an SSH client such as Putty http://www.putty.org/. If you are on a shared server, the Hostek.com support team will need to enable access for you to see the area below. | ||
+ | |||
To generate a new key: | To generate a new key: | ||
− | #Click Manage SSH Keys. | + | #Click 'SSH/Shell Access' within the cPanel home page (once logged in). |
− | #Click the Generate a new Key icon. | + | #Click 'Manage SSH Keys'. |
− | #Fill in the appropriate information. | + | #Click the 'Generate a new Key' icon. |
+ | #Fill in the appropriate information. | ||
+ | #*Note: You should consider your needs when choosing a key type, bearing in mind that RSA keys yield a faster confirmation of identity, while using DSA keys will speed up key generation and signing times. | ||
#Click Generate Key to generate the new SSH key and automatically install it to the server. | #Click Generate Key to generate the new SSH key and automatically install it to the server. | ||
Latest revision as of 13:53, 3 April 2017
Contents
SSH
The dedicated IP and port for SSH access on Linux VPS servers will be included in the email with server details. Alternatively we have an alternate port which can be used for SSH however this will need to be configured. Please email support for the alternate port number and follow the steps below.
Configuring alternate SSH port for your VPS
- NOTE You must be familiar with editing Linux text files from a command prompt to proceed.
- Contact support for the alternate SSH port to use.
- If you have requested your VPS to not be behind our perimiter firewall and you are 100% managing your own firewall, then you can use any TCP port that you wish
- Add the alternate TCP port to the cPanel firewall:
- Log into WHM of your server
- Scroll down and select ConfigServer Security&Firewall
- Click Firewall Configuration
- Edit the TCP_IN line, adding the alternate SSH port, being careful to have comma before and after the number
- Pay close attention to the formatting of the current entries in this line. Syntax errors will result in your VPS firewall failing to restart
- Click Change button at the bottom
- Configure SSH to use the new port:
- SSH into your VPS on the default port 22
- Edit the /etc/ssh/sshd_config file
- Change the line "Port 22" to "Port ####" (without quotes) where #### is the alternate port
- Save your changes
- Run the following command to restart the ssh service:
- service sshd restart
- NOTE Do not disconnect your ssh session after restarting the service until you verify with a new session that your changes are successful. Otherwise you will not be able to correct any syntax errors in the sshd_config file
- While your SSH session is still open, launch a new ssh session to your server, connecting on the new port 4805
- If you get a connection failed, check the /etc/ssh/sshd_config file for syntax errors and correct. Run the command "service sshd restart" (without quotes) after making any changes to the sshd_config file.
Connecting to your server with a SSH key
To connect via SSH you'll first need to download an SSH client such as Putty http://www.putty.org/. If you are on a shared server, the Hostek.com support team will need to enable access for you to see the area below.
To generate a new key:
- Click 'SSH/Shell Access' within the cPanel home page (once logged in).
- Click 'Manage SSH Keys'.
- Click the 'Generate a new Key' icon.
- Fill in the appropriate information.
- Note: You should consider your needs when choosing a key type, bearing in mind that RSA keys yield a faster confirmation of identity, while using DSA keys will speed up key generation and signing times.
- Click Generate Key to generate the new SSH key and automatically install it to the server.
View or Download SSH Key
To view or download a key:
- Click View/Download next to the corresponding key in the appropriate table. You will be directed to a new page.
- Click Download Key to download the key. You can also copy the key and save it on your computer.
Convert SSH private key
To convert a private key and save it onto the server:
- Enter the key's passphrase into the box.
- Click Convert. You will be directed to a new page.
- Click Download Key to download the converted key to your desktop.
Authorize and Deauthorize SSH Key
Note: You will need to authorize a key before using it to connect to the server. To authorize or deauthorize a key: Click Manage Authorization next to the corresponding key in the appropriate table. You will be directed to a new page. Click Authorize or Deauthorize.