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