shoper
V2EX  ›  问与答

请问OPENVZ的VPS如何开通SSH服务的443端口?

  •  
  •   shoper · May 23, 2013 · 5726 views
    This topic created in 4912 days ago, the information mentioned may be changed or developed.
    在公司的内网连SSH的IP能PING通,但用22端口始终失败。
    隔壁同事买的SSH服务用443端口就能连通。
    所以想在自己搭的VPS上也试着开通443端口试试,
    Google不到相应的结果。
    求助啦。
    15 replies  •  1970-01-01 08:00:00 +08:00
    phuslu
    phuslu
    May 23, 2013
    1
    推荐安装 dropbear 然后修改配置在 443 端口。
    shoper
    shoper
    OP
    May 23, 2013
    2
    @phuslu 是不是要SSH登录到VPS上去改?
    sNullp
    sNullp
    May 23, 2013
    3
    /etc/ssh/sshd_config
    shoper
    shoper
    OP
    May 23, 2013
    4
    @sNullp 那能够22和443端口同时开着吗?
    sNullp
    sNullp
    May 23, 2013
    5
    @shoper 能
    shoper
    shoper
    OP
    May 23, 2013
    6
    在 /etc/ssh/sshd_confg文件中(注意是sshd_confg,有个d,不是ssh_conf)中修改

    #Port 22 注释此行,修改为443
    Port 443
    #Protocol 2,1
    Protocol 2
    #AddressFamily any
    #ListenAddress 0.0.0.0
    #ListenAddress ::


    然后保存退出,试用重启命令如下,重启ssh

    /etc/init.d/sshd restart


    再次连接你的ssh的时候端口改为443即可
    shoper
    shoper
    OP
    May 23, 2013
    7
    @sNullp 上面这段貌似是把22改成443,那如何保留22端口呢?
    hadoop
    hadoop
    May 23, 2013 via Android
    8
    @shoper 把port 22那行注释去掉
    sNullp
    sNullp
    May 23, 2013
    9
    @shoper 你不要注释Port 22不就行了= =
    shoper
    shoper
    OP
    May 23, 2013
    10
    @sNullp 按照上面的执行后,还是无法连接,甚至把22端口那行删掉,22还是可以连接,不知道问题出在哪里了。
    sNullp
    sNullp
    May 23, 2013
    11
    @shoper 你service sshd restart了没
    shoper
    shoper
    OP
    May 23, 2013
    12
    @sNullp 按照/etc/init.d/sshd restart这句命令重启过了。
    shoper
    shoper
    OP
    May 23, 2013
    13
    我是修改成这样的

    #Port 22
    #Port 443
    #Protocol 2,1
    Protocol 2
    #AddressFamily any
    #ListenAddress 0.0.0.0
    #ListenAddress ::
    66450146
    66450146
    May 23, 2013
    14
    @shoper
    Port 22
    Port 443
    #Protocol 2,1
    Protocol 2
    #AddressFamily any
    #ListenAddress 0.0.0.0
    #ListenAddress ::
    shoper
    shoper
    OP
    May 23, 2013
    15
    @66450146 汗,原来#号是不执行的语句啊。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3365 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 10:38 · PVG 18:38 · LAX 02:38 · JFK 05:38
    ♥ Do have faith in what you're doing.