CentOS 6web
# yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
CentOS 7服務器
# yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# yum install sslh
默認狀況下,web服務器監聽全部網絡接口,確保web服務器只監聽localhost:443而不是*:443,修改配置文件後須要重啓web服務器生效網絡
修改sslh配置文件ssh
# vi /etc/sslh.cfg測試
# Change hostname with your external address name. listen: ( { host: "0.0.0.0"; port: "443"; } );
設置自啓,並啓動sshld服務spa
# chkconfig sslh on
# service sslh start
測試sslh服務是否運行正常code
$ ps -ef | grep sslh
$ ssh -p 443 root@localhost