Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Running Raspberry Pi 3B/4B #7

Open
davideuler opened this issue Apr 5, 2022 · 0 comments
Open

Running Raspberry Pi 3B/4B #7

davideuler opened this issue Apr 5, 2022 · 0 comments

Comments

@davideuler
Copy link
Owner

davideuler commented Apr 5, 2022

1.镜像烧录
Pi 3B+, Pi 4B 都可以使用 ARM 64 的镜像。 官方工具 Raspberry Pi Imager 可以选择 Use Custom Image 来使用本地下载好的 img/zip 镜像安装到 存储卡。

apt-get install docker.io

apt-get install dfc git tmux tig
apt-get install iptraf-ng curl lsof wget telnet hstr

hstr --show-configuration >> ~/.bashrc

2.配置代理:
Setting up proxy for apt:

Navigate to the following folder, and create a file 10proxy:
vi /etc/apt/apt.conf.d/10proxy

Without authentication add this line:
Acquire::http::Proxy "http://proxyaddress:proxyport/";

Or with authentication add this line:
Acquire::http::Proxy "http://username:password@proxyaddress:proxyport/";

Make sure to include the / at the end.

For everything else:
Edit /etc/environment and set 3 lines to proxy both secure insecure requests
(The export keyword is no longer supported in the /etc/environment file):

http_proxy="http://username:password@proxyaddress:port/"
https_proxy="http://username:password@proxyaddress:port/"
no_proxy="localhost,127.0.0.1"

3.Install Docker
apt-get install docker.io

4.Run a proxy server
https://hub.docker.com/r/teddysun/trojan

5.公网访问家中树莓派
https://www.cnblogs.com/kwongtai/p/6903420.html
https://blog.csdn.net/probezy/article/details/118483908
https://blog.51cto.com/u_15127679/2851130

树莓派机器建立到公网的 ssh 反向代理(-p 可以省略,7280 是在 服务器上开的):
ssh -p 22 -i /home/david/xxx.pem -fCNR 7280:localhost:22 root@101.200.2.5

登陆到 101.200.2.5 的公网服务器之后,即可通过 7280端口连接到树莓派:
检查端口: netstat -anp | grep 7280
登陆树莓派: ssh -p 7280 pi@localhost

再进一步,在 101.200.2.5 的公网服务器做一个本地端口转发,1860 转发到 7280:
ssh -i /data/xxx.pem -fCNL *:1860:localhost:7280 localhost

这个时候可以通过访问 101.200.2.5 的 1860 来ssh到树莓派。

ssh -p 1860 pi@101.200.2.5

用户名换成自己的树莓派用户名,默认是 pi。

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant