使用软件代理

使用ssh代理

参考文章:

步骤:

  1. 私有电脑启动服务

    jupyter notebook --generate-config
    # c.NotebookApp.allow_origin = '*' #allow all origins
    # c.NotebookApp.ip = '0.0.0.0' # listen on all IPs 
    jupyter notebook
    

    远程访问jupyter:https://stackoverflow.com/questions/42848130/why-i-cant-access-remote-jupyter-notebook-server

  2. 反向代理

    ssh -R 9020:127.0.0.1:8888 root@sunie.top

    本地电脑上开不开启防火墙无所谓

  3. 代理服务器设置

    • 在远程服务器上打开端口9020

    • 编辑/etc/ssh/sshd_configGatewayPorts yes

  4. 访问sunie.top:9020

使用Frp代理

参考文章:

使用docker部署会出现无法访问的问题,docker网络与外部网络是隔绝的,需要进行一些配置。除此之外,frp是非常轻量的服务,也完全不必使用docker

步骤:

  1. 服务端VPS客户端私人电脑下载对应版本的frp:https://github.com/fatedier/frp/releases
  2. 配置服务端
    • vim frps.ini
[common]
bind_port = 9020
dashboard_port = 9019
vhost_http_port = 9018
log_file = ./frps.log
log_level = info
log_max_days = 3
disable_log_color = false
token = 123
max_pool_count = 5
tcp_mux = true
  1. 配置客户端
    • vim frpc.ini,注意不同服务的命名不同,type必须是tcp(http: remote_port字段无效,都会代理到vhost_http_port,访问时显示未配置好)
[common]
server_addr = 82.157.121.52
server_port = 9020
token = 123

[zdir]
type = tcp
local_ip = 127.0.0.1
local_port = 9021
remote_port = 9021
custom_domains = zdir.sunie.top

[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 9022
custom_domains = ssh.sunie.top

内网穿透——windows

按照上述方式4步进行连接之后仍然出现“你的凭证无效”,原来因为是用本机连接本机,而不能进入

换在其他Win电脑登录本机,在远程连接时,本机电脑会黑屏,这可能是本机不能登录本机的原因

[common]
server_addr = 82.157.121.52
server_port = 9020
token = 123

[ssh_32g]
type = tcp
local_ip = localhost
local_port = 22
remote_port = 9012

[desktop_32g]
type = tcp
local_ip = 0.0.0.0
local_port = 3389
remote_port = 9011

开机启动——wsl

不能按照一般的ubuntu系统配置

https://zhuanlan.zhihu.com/p/47733615