Difference between revisions of "Ssh"

From vpsget wiki
Jump to: navigation, search
 
Line 21: Line 21:
 
Edit the port (choose any port from range 1025-65535), for example 20120
 
Edit the port (choose any port from range 1025-65535), for example 20120
 
  Port 20120
 
  Port 20120
Make sure you have the port opened in firewall
+
Make sure you have the port opened in firewall.
 +
 
 
Restart ssh (CentOS):
 
Restart ssh (CentOS):
 
  service sshd restart
 
  service sshd restart
  
 
Disable root login.
 
Disable root login.
 +
 
Before disabling root login, create your own user, otherwise you will simply lose access to the server.
 
Before disabling root login, create your own user, otherwise you will simply lose access to the server.
 +
 +
Find the line:
 +
#PermitRootLogin yes
 +
Edit the directive:
 +
PermitRootLogin no
 +
Restart ssh.
 +
 
[[Category:Linux]]
 
[[Category:Linux]]

Latest revision as of 15:53, 17 November 2014

Secure shell(ssh)is a network protocol for secure data communication with your server

How to use ssh

To connect to your server use ssh client like putty.

1. Download putty and run it.

2. In a window appeared enter your server IP or domain name, ssh port (22 by defailt), login (usually: root) and password.

3. Press "Connect".

If connection is successful you should see command prompt. Now you can enter commands to operate your server.

[root@test ~]# 


Securing ssh

Open the config file: /etc/ssh/sshd_config and change the default ssh port.

Find the following string:

#Port 22

Edit the port (choose any port from range 1025-65535), for example 20120

Port 20120

Make sure you have the port opened in firewall.

Restart ssh (CentOS):

service sshd restart

Disable root login.

Before disabling root login, create your own user, otherwise you will simply lose access to the server.

Find the line:

#PermitRootLogin yes

Edit the directive:

PermitRootLogin no

Restart ssh.