标签:
Liunx : use port [ 443] to access https && ssh
1 #!/usr/bin/env bash 2 3 set -e 4 [ -n "$DEBUG" ] && set -x 5 6 # check if user is root 7 if [ $(id -u) != "0" ] ; then 8 echo -e "\033[31mError: You must run this script as root.\033[0m" 9 exit 1 10 fi 11 12 # install epel repo 13 if [ -z "$(rpm -qa | grep ‘epel-release‘)" ] ; then 14 SYSTEM=$(uname -r) 15 case "$SYSTEM" in 16 *el6*) 17 rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm;; 18 *el7*) 19 rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm;; 20 *) 21 echo "Unknown system: $SYSTEM"; exit 1;; 22 esac 23 fi 24 25 # install sslh 26 yum -y install sslh --enablerepo=epel 27 28 # change hostname 29 sed -i ‘s/{ host: "[^"]*";/{ host: "0.0.0.0";/‘ /etc/sslh.cfg 30 31 # enable and start service 32 chkconfig sslh on 33 service sslh start
Now , you can login
$ ssh -p 443 user@ip
标签:
原文地址:http://www.cnblogs.com/Nancy0401/p/5545267.html