使用 Windows Terminal 替代 Xshell

2020-04-29 19:08:50 +08:00
 godlovesxcjtest

使用过一段时间的 Xshell 和 Mobaxterm,功能确实强大,但是我只是需要一个简单的 ssh 管理软件,有 ssh 功能、能帮我记住 ip 就可以,正好赶上 WSL2 即将正式推出,那就折腾一下 windows terminal 吧,反正 wsl2 发布了肯定会用。

在配置里面添加几行就可以使用了

{
  "commandline": "powershell.exe ssh root@192.168.0.202",
  
  "guid": "{2d774c23-c36e-4361-8991-9712e5af58c8}",
  
  "hidden": false,
  
  "icon": "C:\\Users\\godlo\\.ssh\\linux.png",
  
  "name": "N1-Armbian"
}

这是效果图,配置 SSH 公钥登录后,使用确实很方便,还可以快捷键快速打开对应标签,直接连接 但是有一个问题,就是不支持 ZModem 协议,也就不能使用 rz 和 sz 这样的命令,目前只能使用 sftp 简单的替代下 如下图:

大家有什么好的办法么?

9239 次点击
所在节点    Windows
11 条回复
codehz
2020-04-29 19:11:13 +08:00
(我建议用专用软件代替,喜欢 uwp 的可以用 Token2Shell (
MeteorCat
2020-04-29 19:13:17 +08:00
xshell 主要是密钥证书管理,不是什么花里胡哨的
godlovesxcjtest
2020-04-29 19:13:20 +08:00
@codehz #1 这不是为信仰充值嘛
iamwho
2020-04-29 19:13:22 +08:00
~\.ssh\config:"???"
godlovesxcjtest
2020-04-29 19:14:40 +08:00
@MeteorCat #2 我说他花里胡哨了吗??,我自己也挺喜欢 xshell 的
ragnaroks
2020-04-29 19:46:15 +08:00
只有我是当 cmd 替代用的?
Norie
2020-04-29 20:00:58 +08:00
win10 就是最好的 Linux 发行版
lionseun
2020-04-30 08:57:57 +08:00
@iamwho 我就是用这个
godlovesxcjtest
2020-04-30 09:37:13 +08:00
@lionseun #8 所以更改客户端的 ssh config 可以支持[xyz]Modem 吗?具体怎样做呢
ps1aniuge
2020-04-30 22:58:19 +08:00
## 目的:打开一个新 win term 标签后,则进入 linux 种的,powershell 远程命令行。

## win term:
"commandline" : "C:\\Program Files\\PowerShell\\7-preview\\pwsh.exe -noexit -file d:\\ps 脚本\\ssh_to_ps62.ps1",


## ssh_to_ps62.ps1
param
(
[String]$目的 ip 地址 = '192.168.1.62',
$端口 = 22,
$账户 = 'root',
$ssh_key_文件路径 = "$env:USERPROFILE\.ssh\id_rsa"
)

$msg = @'
需要 ssh.exe,低版本 win 请去这里下载: https://github.com/PowerShell/Win32-OpenSSH/releases
建议在 Windows Terminal 中使用:
"commandline" : "C:\\Program Files\\PowerShell\\7-preview\\pwsh.exe -noexit -file d:\\ps 脚本\\centos7.ps1",
'@

Write-Warning $msg


if ($PSVersionTable.psversion.major -ge 6)
{
Write-Host -ForegroundColor green "进入目的 ip [$目的 ip 地址] "
Enter-PSSession -Session (New-PSSession -HostName $目的 ip 地址 -Port $端口 -UserName root -KeyFilePath $ssh_key_文件路径)
}
else
{
Write-Error '需要 powershell 版本 v6 。v7 更好'
}

##linux:
linux 下需要安装 powershell,并修改 /etc/ssh/sshd_config 文件。
使用这里的脚本,可以一键安装,修改。

https://gitee.com/chuanjiao10/kasini3000_agent_linux
lionseun
2020-05-05 08:45:58 +08:00
@godlovesxcjtest ssh config 只是方便 ssh 相关的操作,比如 ssh 连主机,SCP 拉文件

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/667379

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX