SSH連接埠修改

來源:互聯網
上載者:User

Linux下修改22連接埠
 
Linux中SSH預設連接埠為22,為了安全考慮,我們有必要對22連接埠進行修改,現修改連接埠為60000;修改方法如下:
在/etc/ssh/sshd_config中找到Port 22,將其修改為60000,或使用/usr/sbin/sshd -p 60000指定連接埠。
 
[root@localhost /]# vi /etc/ssh/sshd_config
Port 60000
[root@localhost /]# /usr/sbin/sshd -p 60000
[root@localhost /]# service sshd restart
停止 sshd:                                      [  確定  ]
啟動 sshd                                        [  確定  ]
 
如果使用者想讓22和60000連接埠同時開放,只需在/etc/ssh/sshd_config增加一行內容如下:
[root@localhost /]# vi /etc/ssh/sshd_config
Port 22
Port 60000
儲存並退出
[root@localhost /]# /etc/init.d/sshd restart
停止 sshd:                                       [  確定  ]
啟動 sshd                                         [  確定  ]
 
測試
Xshell:\> ssh root@192.168.1.90
Connecting to 192.168.1.90:22...
Connection established.
Escape character is ^@].
Last login: Sun Mar 14 22:44:44 2010 from www-72cbd3ffe95.
[root@localhost ~]#
 
Xshell:\> ssh root@192.168.1.90 60000
Connecting to 192.168.1.90:60000...
Connection established.
Escape character is ^@].
Last login: Sun Mar 14 22:47:47 2010 from www-72cbd3ffe95.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.