Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

不知道怎么给wiki提pr,大佬看下能不能更新下wiki上关于ssh的说明 #42

Closed
KonpakuSyl opened this issue Nov 25, 2023 · 2 comments

Comments

@KonpakuSyl
Copy link

windows上的使用方法

下载并安装nmap: https://nmap.org/download.html#windows

创建powershell文件C:\Users\yourname\proxy.ps1,并写入以下内容:

param(
    [string]$sshhost
)

# 使用 Resolve-DnsName 获取 IPv6 地址
$raw = (Resolve-DnsName -Name $sshhost -Type AAAA).IPAddress

# 将 IPv6 地址的端口和地址部分提取出来
$port = [int]('0x'+($raw -split ':')[2])
$ipab = [int]('0x'+($raw -split ':')[3])
$ipcd = [int]('0x'+($raw -split ':')[4])

# 计算 IP 地址的各个部分
$ipa = $ipab -shr 8
$ipb = $ipab -band 0xFF
$ipc = $ipcd -shr 8
$ipd = $ipcd -band 0xFF

# 使用 ncat 进行连接
ncat "$ipa.$ipb.$ipc.$ipd" $port

再向~/.ssh/config中增加ssh配置:

Host ssh.hev.cc
    ProxyCommand powershell C:\Users\yourname\proxy.ps1 %h
@heiher
Copy link
Owner

heiher commented Nov 25, 2023

非常感谢,能否提供一个Patch,我合入以保留作者信息。

git clone https://github.com/heiher/natmap.wiki.git

@KonpakuSyl
Copy link
Author

非常感谢,能否提供一个Patch,我合入以保留作者信息。

git clone https://github.com/heiher/natmap.wiki.git

natmap.wiki-b04608f-doc 添加windows的ssh说明.patch

@heiher heiher closed this as completed Nov 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants