ARM64/Ubuntu18-frp-client-based-golang (frp client) proxy tunnel to Internet server


##### Internal net


Using username "khadas".
[email protected]'s password:khadas

Welcome to Fenix 0.8.3 Ubuntu 18.04.4 LTS Linux 4.9.206
 _  ___               _            __  ______
| |/ / |__   __ _  __| | __ _ ___  \ \/ / ___|
| ' /| '_ \ / _` |/ _` |/ _` / __|  \  /|___ \
| . \| | | | (_| | (_| | (_| \__ \  /  \ ___) |
|_|\_\_| |_|\__,_|\__,_|\__,_|___/ /_/\_\____/


 * Website:        https://www.khadas.com
 * Documentation:  https://docs.khadas.com
 * Forum:          https://forum.khadas.com

Last login: Wed Apr 29 16:04:39 2020 from 192.168.137.1
khadas@Khadas:~$
khadas@Khadas:~$ sudo  /bin/bash
[sudo] password for khadas:khadas

root@Khadas:~# ls
sources.list
root@Khadas:~# ping  www.baidu.com
PING www.a.shifen.com (180.101.49.12) 56(84) bytes of data.
64 bytes from 180.101.49.12 (180.101.49.12): icmp_seq=1 ttl=53 time=6.26 ms
64 bytes from 180.101.49.12 (180.101.49.12): icmp_seq=2 ttl=53 time=11.4 ms
^C
--- www.a.shifen.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 6.266/8.849/11.433/2.585 ms

root@Khadas:~#  apt-get install golang
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  golang-1.10 golang-1.10-doc golang-1.10-go golang-1.10-src golang-doc golang-go golang-src
Suggested packages:
  bzr mercurial subversion
The following NEW packages will be installed:
  golang golang-1.10 golang-1.10-doc golang-1.10-go golang-1.10-src golang-doc golang-go golang-src
0 upgraded, 8 newly installed, 0 to remove and 63 not upgraded.
Need to get 39.3 MB of archives.
After this operation, 210 MB of additional disk space will be used.
Do you want to continue? [Y/n] ^C
root@Khadas:~# apt-get install   golang-1.10      golang-1.10-go      golang-go
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  golang-1.10-doc golang-1.10-src golang-src
Suggested packages:
  bzr mercurial subversion
The following NEW packages will be installed:
  golang-1.10 golang-1.10-doc golang-1.10-go golang-1.10-src golang-go golang-src
0 upgraded, 6 newly installed, 0 to remove and 63 not upgraded.
Need to get 39.3 MB of archives.
After this operation, 210 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic-updates/main arm64 golang-1.10-src arm64 1.10.4-2ubuntu1~18.04.1 [11.1 MB]
Get:2 http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic-updates/main arm64 golang-1.10-go arm64 1.10.4-2ubuntu1~18.04.1 [25.7 MB]
Get:2 http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic-updates/main arm64 golang-1.10-go arm64 1.10.4-2ubuntu1~18.04.1 [25.7 MB]
Get:3 http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic-updates/main arm64 golang-1.10-doc all 1.10.4-2ubuntu1~18.04.1 [2,419 kB]
Get:4 http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic-updates/main arm64 golang-1.10 all 1.10.4-2ubuntu1~18.04.1 [11.2 kB]
Get:5 http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic/main arm64 golang-src arm64 2:1.10~4ubuntu1 [3,676 B]
Get:6 http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports bionic/main arm64 golang-go arm64 2:1.10~4ubuntu1 [22.0 kB]
Fetched 37.1 MB in 54s (690 kB/s)
Selecting previously unselected package golang-1.10-src.
(Reading database ... 107294 files and directories currently installed.)
Preparing to unpack .../0-golang-1.10-src_1.10.4-2ubuntu1~18.04.1_arm64.deb ...
Unpacking golang-1.10-src (1.10.4-2ubuntu1~18.04.1) ...
Selecting previously unselected package golang-1.10-go.
Preparing to unpack .../1-golang-1.10-go_1.10.4-2ubuntu1~18.04.1_arm64.deb ...
Unpacking golang-1.10-go (1.10.4-2ubuntu1~18.04.1) ...
Selecting previously unselected package golang-1.10-doc.
Preparing to unpack .../2-golang-1.10-doc_1.10.4-2ubuntu1~18.04.1_all.deb ...
Unpacking golang-1.10-doc (1.10.4-2ubuntu1~18.04.1) ...
Selecting previously unselected package golang-1.10.
Preparing to unpack .../3-golang-1.10_1.10.4-2ubuntu1~18.04.1_all.deb ...
Unpacking golang-1.10 (1.10.4-2ubuntu1~18.04.1) ...
Selecting previously unselected package golang-src.
Preparing to unpack .../4-golang-src_2%3a1.10~4ubuntu1_arm64.deb ...
Unpacking golang-src (2:1.10~4ubuntu1) ...
Selecting previously unselected package golang-go.
Preparing to unpack .../5-golang-go_2%3a1.10~4ubuntu1_arm64.deb ...
Unpacking golang-go (2:1.10~4ubuntu1) ...
Setting up golang-1.10-src (1.10.4-2ubuntu1~18.04.1) ...
Setting up golang-src (2:1.10~4ubuntu1) ...
Setting up golang-1.10-go (1.10.4-2ubuntu1~18.04.1) ...
Setting up golang-1.10-doc (1.10.4-2ubuntu1~18.04.1) ...
Setting up golang-go (2:1.10~4ubuntu1) ...
Setting up golang-1.10 (1.10.4-2ubuntu1~18.04.1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
root@Khadas:~#  ls
frp_0.33.0_linux_amd64.tar.gz  sources.list
root@Khadas:~# vim hello-go.go
root@Khadas:~# cat  hello-go.go
package main
import "fmt"

func main(){
    fmt.Printf("hello world\n")
}

root@Khadas:~# go run hello-go.go
hello world

root@Khadas:~# ls
frp_0.33.0_linux_amd64.tar.gz  hello-go.go  sources.list
root@Khadas:~# tar zxf frp_0.33.0_linux_amd64.tar.gz ^C
root@Khadas:~# ls
frp_0.33.0_linux_amd64.tar.gz  hello-go.go  sources.list
root@Khadas:~# wget  https://github.com/fatedier/frp/releases/download/v0.33.0/frp_0.33.0_linux_arm64.tar.gz
--2020-04-29 17:35:18--  https://github.com/fatedier/frp/releases/download/v0.33.0/frp_0.33.0_linux_arm64.tar.gz
Resolving github.com (github.com)... 13.250.177.223
Connecting to github.com (github.com)|13.250.177.223|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://github-production-release-asset-2e65be.s3.amazonaws.com/48378947/1ddd8d00-88ad-11ea-9fe9-839686554d5c?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200429%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200429T093518Z&X-Amz-Expires=300&X-Amz-Signature=aa42b11c673835f1467b67b28c339cb1d90be7072efe371ca1cd04c432e91326&X-Amz-SignedHeaders=host&actor_id=0&repo_id=48378947&response-content-disposition=attachment%3B%20filename%3Dfrp_0.33.0_linux_arm64.tar.gz&response-content-type=application%2Foctet-stream [following]
--2020-04-29 17:35:19--  https://github-production-release-asset-2e65be.s3.amazonaws.com/48378947/1ddd8d00-88ad-11ea-9fe9-839686554d5c?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200429%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200429T093518Z&X-Amz-Expires=300&X-Amz-Signature=aa42b11c673835f1467b67b28c339cb1d90be7072efe371ca1cd04c432e91326&X-Amz-SignedHeaders=host&actor_id=0&repo_id=48378947&response-content-disposition=attachment%3B%20filename%3Dfrp_0.33.0_linux_arm64.tar.gz&response-content-type=application%2Foctet-stream
Resolving github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)... 52.216.138.67
Connecting to github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)|52.216.138.67|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8314106 (7.9M) [application/octet-stream]
Saving to: ‘frp_0.33.0_linux_arm64.tar.gz’

frp_0.33.0_linux_arm64.tar.gz                               100%[========================================================================================================================================>]   7.93M  55.4KB/s    in 9m 5s

2020-04-29 17:44:24 (14.9 KB/s) - ‘frp_0.33.0_linux_arm64.tar.gz’ saved [8314106/8314106]


root@Khadas:~# ls
frp_0.33.0_linux_arm64.tar.gz  hello-go.go  sources.list
root@Khadas:~# tar zxf frp_0.33.0_linux_arm64.tar.gz
root@Khadas:~# ls
frp_0.33.0_linux_arm64  frp_0.33.0_linux_arm64.tar.gz  hello-go.go  sources.list
root@Khadas:~# cd frp_0.33.0_linux_arm64/
root@Khadas:~/frp_0.33.0_linux_arm64# ls
frpc  frpc_full.ini  frpc.ini  frps  frps_full.ini  frps.ini  LICENSE  systemd
root@Khadas:~/frp_0.33.0_linux_arm64# ls -l
total 21992
-rwxrwxr-x 1 khadas khadas 10092544 Apr 27 17:00 frpc
-rw-rw-r-- 1 khadas khadas     7575 Apr 27 17:06 frpc_full.ini
-rw-rw-r-- 1 khadas khadas      126 Apr 27 17:06 frpc.ini
-rwxrwxr-x 1 khadas khadas 12386304 Apr 27 17:01 frps
-rw-rw-r-- 1 khadas khadas     4639 Apr 27 17:06 frps_full.ini
-rw-rw-r-- 1 khadas khadas       26 Apr 27 17:06 frps.ini
-rw-rw-r-- 1 khadas khadas    11358 Apr 27 17:06 LICENSE
drwxrwxr-x 2 khadas khadas     4096 Apr 27 17:06 systemd

############# Proxy tunnel server/47.114.46.84 on Internet 
root@Khadas:~/frp_0.33.0_linux_arm64# ping  47.114.46.84
PING 47.114.46.84 (47.114.46.84) 56(84) bytes of data.
64 bytes from 47.114.46.84: icmp_seq=1 ttl=51 time=12.0 ms
64 bytes from 47.114.46.84: icmp_seq=2 ttl=51 time=10.8 ms
^C
--- 47.114.46.84 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 10.833/11.451/12.070/0.627 ms
root@Khadas:~/frp_0.33.0_linux_arm64# ls
frpc  frpc_full.ini  frpc.ini  frps  frps_full.ini  frps.ini  LICENSE  systemd
root@Khadas:~/frp_0.33.0_linux_arm64# pwd
/home/khadas/frp_0.33.0_linux_arm64
root@Khadas:~/frp_0.33.0_linux_arm64# ls
frpc  frpc_full.ini  frpc.ini  frps  frps_full.ini  frps.ini  LICENSE  systemd
root@Khadas:~/frp_0.33.0_linux_arm64# vim frpc
root@Khadas:~/frp_0.33.0_linux_arm64# ls
frpc  frpc_full.ini  frpc.ini  frps  frps_full.ini  frps.ini  LICENSE  systemd
root@Khadas:~/frp_0.33.0_linux_arm64# ls
frpc  frpc_full.ini  frpc.ini  frps  frps_full.ini  frps.ini  LICENSE  systemd
root@Khadas:~/frp_0.33.0_linux_arm64# vim frpc.ini


root@Khadas:~/frp_0.33.0_linux_arm64# cat frpc.ini
[common]
server_addr = 47.114.46.84
server_port = 7000

[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6001
root@Khadas:~/frp_0.33.0_linux_arm64# ls^C
root@Khadas:~/frp_0.33.0_linux_arm64#  ./frpc    -c   frpc.ini
2020/04/30 15:42:57 [I] [service.go:282] [3e3edd5b2296ebfa] login to server success, get run id [3e3edd5b2296ebfa], server udp port [0]
2020/04/30 15:42:57 [I] [proxy_manager.go:144] [3e3edd5b2296ebfa] proxy added: [ssh]
2020/04/30 15:42:57 [I] [control.go:179] [3e3edd5b2296ebfa] [ssh] start proxy success

####################################################
############# Proxy tunnel server/47.114.46.84 on Internet   run frps (frp server side ) 
####################################################

47.114.46.84 

[iot@yl-repo-2 ~]$ netstat -an --tcp  |grep  7000
tcp6       0      0 :::7000                 :::*                    LISTEN
tcp6       0      0 172.16.86.216:7000      49.72.115.68:39126      ESTABLISHED
tcp6       0      0 172.16.86.216:7000      49.72.115.68:60968      ESTABLISHED
[iot@yl-repo-2 ~]$ ssh -oPort=6001  [email protected]
The authenticity of host '[127.0.0.1]:6001 ([127.0.0.1]:6001)' can't be established.
ECDSA key fingerprint is SHA256:bDIyVJP3oCaPAS4wGdxCSnGcR6WF3XjHYKsCfzFSd1A.
ECDSA key fingerprint is MD5:83:12:60:bc:96:b8:80:84:d8:30:3b:7a:91:92:96:78.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[127.0.0.1]:6001' (ECDSA) to the list of known hosts.
[email protected]'s password:

Welcome to Fenix 0.8.3 Ubuntu 18.04.4 LTS Linux 4.9.206
 _  ___               _            __  ______
| |/ / |__   __ _  __| | __ _ ___  \ \/ / ___|
| ' /| '_ \ / _` |/ _` |/ _` / __|  \  /|___ \
| . \| | | | (_| | (_| | (_| \__ \  /  \ ___) |
|_|\_\_| |_|\__,_|\__,_|\__,_|___/ /_/\_\____/


 * Website:        https://www.khadas.com
 * Documentation:  https://docs.khadas.com
 * Forum:          https://forum.khadas.com

Last login: Thu Apr 30 15:40:46 2020 from 192.168.137.33
khadas@Khadas:~$ uname -a
Linux Khadas 4.9.206 #2 SMP PREEMPT Fri Apr 3 02:47:33 CST 2020 aarch64 aarch64 aarch64 GNU/Linux
khadas@Khadas:~$ cat /proc/version
Linux version 4.9.206 (zerone@vdihost) (gcc version 7.3.1 20180425 [linaro-7.3-2018.05 revision d29120a424ecfbc167ef90065c0eeb7f91977701] (Linaro GCC 7.3-2018.05) ) #2 SMP PREEMPT Fri Apr 3 02:47:33 CST 2020
khadas@Khadas:~$

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章