内网穿透

4 篇文章 0 订阅

ZeroTier

用户手册
操作面板

server安装

  • Windows MSI Installer (x86/x64)
  • MacOS MacOS PKG Installer
    • command line
    # Get your ZeroTier address and check the service status
    sudo zerotier-cli status
    
    # Join, leave, and list networks
    sudo zerotier-cli join ################
    sudo zerotier-cli leave ################
    sudo zerotier-cli listnetworks
    
    # Stop and start the service with launchctl
    sudo launchctl unload /Library/LaunchDaemons/com.zerotier.one.plist
    sudo launchctl load /Library/LaunchDaemons/com.zerotier.one.plist
    
    # Cleanly uninstall ZeroTier One, preserving only your secret identity
    sudo "/Library/Application Support/ZeroTier/One/uninstall.sh"
    
  • Apple iOS App Store
  • Android Google Play Store
  • Linux (DEB/RPM)
    • rely on SSL to authenticate the site
    curl -s https://install.zerotier.com | sudo bash
    
    • have GPG installed
    curl -s 'https://raw.githubusercontent.com/zerotier/ZeroTierOne/master/doc/contact%40zerotier.com.gpg' | gpg --import && \
    if z=$(curl -s 'https://install.zerotier.com/' | gpg); then echo "$z" | sudo bash; fi
    
  • FreeBSD FreeBSD Package

加入网络

type zerotier-cli join ################ with ############### being the 16-digit network ID of the network
启动和开机自启动

$ sudo systemctl start zerotier-one.service
$ sudo systemctl enable zerotier-one.service

problems:

  • 提示zerotier-cli: missing authentication token and authtoken.secret not found (or readable) in /var/lib/zerotier-one
    解决chmod 755 /var/lib/zerotier-one/authtoken.secret
  • 每次join network都会新建新的网络端口, 增加网络数
    解决 在计算机\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles中删除ProfileName以"网络"开头的条目
    管理员运行PowerShell
Get-ChildItem ’HKLM:\Software\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles\’ |
ForEach-Object{
	$profilename = $_.GetValue('ProfileName')
	if($profilename.StartsWith("网络 ")){
		Write-Host "Removing item: $profilename" -ForegroundColor green
		Remove-Item $_.PSPath -Whatif
	}else{
		Write-Host "Skipping item:$profilename" -Fore blue -Back white
	}
}

端口转发

ssh

ssh命令

Squid

参考1, 2, 3
linux在/etc/squid.conf, mac在/usr/local/etc/squid.conf
http_access deny all改为http_access allow all后, service squid restart
在代理中设置端口为3128即可(mac的命令是brew services restart squid)

# 启动
systemctl start squid.service
# 停止
systemctl stop squid.service
# 重启
systemctl restart squid.service
#设置开机自启
systemctl enable squid.service

mac系统的brew替换镜像源

VNC

  • 服务相关
vncserver -kill :1#关掉某个窗口
vncserver :1#开启某个窗口
vncserver start
  • 显示桌面
    编辑~/.vnc/xstartup文件(ref)
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
x-window-manager &
 #在最后添加
gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值