Difference between revisions of "Ssh"
(Created page with "Secure shell(ssh)is a network protocol for secure data communication with your server <h2>How to use ssh</h2> To connect to your server via ssh use ssh client like putty.<br/>...") |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Secure shell(ssh)is a network protocol for secure data communication with your server | Secure shell(ssh)is a network protocol for secure data communication with your server | ||
<h2>How to use ssh</h2> | <h2>How to use ssh</h2> | ||
− | To connect to your server | + | To connect to your server use ssh client like putty. |
− | 1. [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html 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. | + | 1. [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html Download putty] and run it. |
− | 3. Press "Connect". | + | |
− | If connection is successful you should see command | + | 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 ~]# | [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. | ||
[[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.