码迷,mamicode.com
首页 > 系统相关 > 详细

Linux SSLH

时间:2016-05-31 12:07:22      阅读:318      评论:0      收藏:0      [点我收藏+]

标签:

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

 

Linux SSLH

标签:

原文地址:http://www.cnblogs.com/Nancy0401/p/5545267.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!