• 关于frp-ssh部署


    Pub-IP Server

    # git clone https://github.com.cnpmjs.org/fatedier/frp
    wget https://github.com/fatedier/frp/releases/download/v0.37.0/frp_0.37.0_linux_amd64.tar.gz
    tar -xzvf frp_0.37.0_linux_amd64.tar.gz
    cd frp_0.37.0_linux_amd64/
    rm -rf frps.ini
    echo "# frps.ini
    [common]
    bind_port = 7000
    " >> frps.ini
    tmux
    ./frps -c ./frps.ini
    

    Private Server

    Install openssh-server

    1. add to /etc/apt/sources.list
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
    
    1. Install
    sudo apt-get update
    sudo apt-get install openssh-server
    

    Download frp:

    wget https://github.com/fatedier/frp/releases/download/v0.37.0/frp_0.37.0_linux_amd64.tar.gz
    # or wget https://github.com.cnpmjs.org/fatedier/frp/releases/download/v0.37.0/frp_0.37.0_linux_amd64.tar.gz
    tar -xzvf frp_0.37.0_linux_amd64.tar.gz
    cd frp_0.37.0_linux_amd64/
    

    Update config file:

    # frpc.ini
    [common]
    server_addr = x.x.x.x
    server_port = 7000
    
    [ssh]
    type = tcp
    local_ip = 127.0.0.1
    local_port = 22
    remote_port = 6000
    

    Enable frpc.service

    FRPPWD=YOUR_PATH
    sudo echo "[Fusion]
    Description=Frp Server Daemon
    After=syslog.target network.target
    Wants=network.target
    
    [Service]
    Type=simple
    ExecStart=$FRPPWD/frpc -c $FRPPWD/frpc.ini
    ExecStop=/usr/bin/killall frpc
    RestartSec=1min
    KillMode=control-group
    Restart=always
    
    [Install]
    WantedBy=multi-user.target" >> /etc/systemd/frpc.service
    sudo systemctl enable /etc/systemd/frpc.service
    sudo systemctl start frpc.service
    sudo systemctl status frpc.service
    

    Usage

    ssh -oPort=6000 ubuntu@xxxxx
    
  • 相关阅读:
    CodeForces Round #556 Div.2
    #Leetcode# 650. 2 Keys Keyboard
    #Leetcode# 552. Student Attendance Record II
    #Leetcode# 551. Student Attendance Record I
    #Leetcode# 522. Longest Uncommon Subsequence II
    牛客OI周赛9-普及组
    最长回文子序列 (模板)
    C++ 各种排序算法总结
    THU 数据结构 真二叉树重构(Proper Rebuild)
    C++中结构体函数的实现
  • 原文地址:https://www.cnblogs.com/xytpai/p/15088218.html
Copyright © 2020-2023  润新知