home archives github knives links
tags linux ssh windows mac termux 内网穿透
categories
only title title and content
ssh笔记

本地局域网ssh

Linux

启动本地服务

sudo apt-get install openssh-server
sudo apt-get install net-tools
sudo service ssh start
sudo ifconfig
netstat -tlp
ps -e | grep ssh

访问远程服务

ssh 172.27.152.19 -p 2222
ssh -X lynx@192.168.1.100

mac

启动本地服务

TODO

访问远程服务

设置->共享->远程登录

termux

启动本地服务

pkg install openssh
# 或
apt install openssh

# 启动ssh服务
sshd
sshd -p 22222
whoami
passwd

访问远程服务

windows

windows真他妈没卵用

外网ssh访问公网ip

必须保证wlan分配的ip为公网ip:ip138.com上与上网设置中的ip地址要一致

Linux

  1. 192.186.1.1安装虚拟服务器应用

  2. 端口映射

外部端口 内部端口 ip地址 协议类型
用于外网访问的端口 进程的实际端口,ssh默认为22 局域网ip ALL

连接内网

  1. ubuntu查看外网ip

TODO

curl ifconfig.me

外网访问私网ip

ngrok:内网穿透软件

  1. 注册ngrok账号

  2. ./ngrok authtoken ***

  3. ./ngrok tcp 80(例)

  4. 另一台电脑./ssh -X lynx@***.ngrok.io -p ***,端口在Status查看

nat123:TODO
teamviewer