美文网首页
利用 Frp 实现远程 ssh 到实验室 or 家里的台式机

利用 Frp 实现远程 ssh 到实验室 or 家里的台式机

作者: 酷酷滴小爽哥 | 来源:发表于2020-01-15 14:31 被阅读0次

    一、首先购买一个阿里云服务器,然后设置好安全组的出入方向

    二、下载 frp 并设置:

    下载链接:https://github.com/fatedier/frp/releases

    # 命令行下载
    wget https://github.com/fatedier/frp/releases/download/v0.31.1/frp_0.31.1_linux_amd64.tar.gz
    # 解压
    tar -xcvf frp_0.31.1_linux_amd64.tar.gz
    
    • 在云服务器上设置 server 端:
      进入文件夹,将 frps.ini 改为:
    [common]
    bind_port = 7000
    
    • 在自己的台式机上设置 client 端:
      进入文件夹,将 frpc.ini 改为:
    [common]
    server_addr = x.x.x.x    # 这里改为你服务器的公网 IP 地址
    server_port = 7000
    
    [ssh]
    type = tcp
    local_ip = 127.0.0.1
    local_port = 22
    remote_port = 6000
    
    • 分别在 server 端和 client 端执行以下命令:
    # server 端执行
    nohup ./frps -c frps.ini &
    
    # client 端执行
    nohup ./frpc -c frpc.ini &
    

    三、远程连接:

    ssh -p6000 台式机用户名@公网IP
    

    相关文章

      网友评论

          本文标题:利用 Frp 实现远程 ssh 到实验室 or 家里的台式机

          本文链接:https://www.haomeiwen.com/subject/hjstzctx.html