github地址
brew install sshuttle
sshuttle --sudoers-no-modify
visudo /etc/sudoers.d/sshuttle_auto
sudo visudo /etc/sudoers.d/sshuttle_auto_john
sshuttle --sudoers-user fa -r jump.local.container2222-sshuttle.fa.intranet.company 10.0.1.0/24
sshuttle -r root@10.0.1.90 --python $(which python3) 0.0.0.0/0
sshuttle -r root@container2222.fa.intranet.company --python /usr/bin/python3 0.0.0.0/0
sshuttle -r container2222.fa.intranet.company 0.0.0.0/0
sshuttle -r mac.intranet.company 0.0.0.0/0
sshuttle -r mac.intranet.company baidu.com
sudo useradd -r -s /usr/sbin/nologin vpn-tunnel
sudo mkdir -p /home/vpn-tunnel/.ssh
sudo ssh-keygen -t ed25519 -f /etc/ssh/vpn-server-key -N "" -C "vpn-server@company"
sudo chmod 600 /etc/ssh/vpn-server-key*
sudo cp /etc/ssh/vpn-server-key.pub /home/vpn-tunnel/.ssh/authorized_keys
sudo chown -R vpn-tunnel:vpn-tunnel /home/vpn-tunnel/.ssh
Match User vpn-tunnel
AllowTcpForwarding no
PermitTunnel yes
ForceCommand /bin/false
AuthenticationMethods publickey
PermitRootLogin no
X11Forwarding no
AllowAgentForwarding no
IdentityFile /etc/ssh/vpn-server-key
sudo systemctl restart sshd
/usr/sbin/sshd -t
/usr/sbin/sshd -k HUP
sudo ssh-keygen -t ed25519 -f /etc/ssh/ca_key -N ""
sudo ssh-keygen -s /etc/ssh/ca_key -I "vpn-cert" -n vpn-tunnel -V +30d /home/vpn-tunnel/.ssh/authorized_keys