{"id":89910,"date":"2020-05-13T09:46:46","date_gmt":"2020-05-13T01:46:46","guid":{"rendered":"http:\/\/4563.org\/?p=89910"},"modified":"2020-05-13T09:46:46","modified_gmt":"2020-05-13T01:46:46","slug":"%e4%bd%bf%e7%94%a8-windows-terminal-%e6%9b%bf%e4%bb%a3-xshell","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=89910","title":{"rendered":"\u4f7f\u7528 Windows Terminal \u66ff\u4ee3 Xshell"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u4f7f\u7528 Windows Terminal \u66ff\u4ee3 Xshell               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : godlovesxcjtest <\/span>  <span><i><\/i> 11<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u4f7f\u7528\u8fc7\u4e00\u6bb5\u65f6\u95f4\u7684 Xshell \u548c Mobaxterm\uff0c\u529f\u80fd\u786e\u5b9e\u5f3a\u5927\uff0c\u4f46\u662f\u6211\u53ea\u662f\u9700\u8981\u4e00\u4e2a\u7b80\u5355\u7684 ssh \u7ba1\u7406\u8f6f\u4ef6\uff0c\u6709 ssh \u529f\u80fd\u3001\u80fd\u5e2e\u6211\u8bb0\u4f4f ip \u5c31\u53ef\u4ee5\uff0c\u6b63\u597d\u8d76\u4e0a WSL2 \u5373\u5c06\u6b63\u5f0f\u63a8\u51fa\uff0c\u90a3\u5c31\u6298\u817e\u4e00\u4e0b windows terminal \u5427\uff0c\u53cd\u6b63 wsl2 \u53d1\u5e03\u4e86\u80af\u5b9a\u4f1a\u7528\u3002<\/p>\n<p>\u5728\u914d\u7f6e\u91cc\u9762\u6dfb\u52a0\u51e0\u884c\u5c31\u53ef\u4ee5\u4f7f\u7528\u4e86<\/p>\n<pre><code>{   \"commandline\": \"powershell.exe ssh [email&#160;protected]\",      \"guid\": \"{2d774c23-c36e-4361-8991-9712e5af58c8}\",      \"hidden\": false,      \"icon\": \"C:\\Users\\godlo\\.ssh\\linux.png\",      \"name\": \"N1-Armbian\" } <\/code><\/pre>\n<p>\u8fd9\u662f\u6548\u679c\u56fe\uff0c\u914d\u7f6e SSH \u516c\u94a5\u767b\u5f55\u540e\uff0c\u4f7f\u7528\u786e\u5b9e\u5f88\u65b9\u4fbf\uff0c\u8fd8\u53ef\u4ee5\u5feb\u6377\u952e\u5feb\u901f\u6253\u5f00\u5bf9\u5e94\u6807\u7b7e\uff0c\u76f4\u63a5\u8fde\u63a5 <img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/05\/20200518_5ec2f0afb1d0d.png\" alt=\"\u4f7f\u7528 Windows Terminal \u66ff\u4ee3 Xshell\" \/> \u4f46\u662f\u6709\u4e00\u4e2a\u95ee\u9898\uff0c\u5c31\u662f\u4e0d\u652f\u6301 ZModem \u534f\u8bae\uff0c\u4e5f\u5c31\u4e0d\u80fd\u4f7f\u7528 rz \u548c sz \u8fd9\u6837\u7684\u547d\u4ee4\uff0c\u76ee\u524d\u53ea\u80fd\u4f7f\u7528 sftp \u7b80\u5355\u7684\u66ff\u4ee3\u4e0b \u5982\u4e0b\u56fe\uff1a <img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/05\/20200518_5ec2f0afe015f.png\" alt=\"\u4f7f\u7528 Windows Terminal \u66ff\u4ee3 Xshell\" \/><\/p>\n<h2>\u5927\u5bb6\u6709\u4ec0\u4e48\u597d\u7684\u529e\u6cd5\u4e48?<\/h2>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>10<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"1328556\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : codehz <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \uff08\u6211\u5efa\u8bae\u7528\u4e13\u7528\u8f6f\u4ef6\u4ee3\u66ff\uff0c\u559c\u6b22 uwp \u7684\u53ef\u4ee5\u7528 Token2Shell (                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1328557\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : MeteorCat <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             xshell \u4e3b\u8981\u662f\u5bc6\u94a5\u8bc1\u4e66\u7ba1\u7406\uff0c\u4e0d\u662f\u4ec0\u4e48\u82b1\u91cc\u80e1\u54e8\u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1328558\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : godlovesxcjtest <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @codehz #1 \u8fd9\u4e0d\u662f\u4e3a\u4fe1\u4ef0\u5145\u503c\u561b                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1328559\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : iamwho <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             ~.sshconfig:&#8221;???&#8221;                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1328560\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : godlovesxcjtest <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @MeteorCat #2 \u6211\u8bf4\u4ed6\u82b1\u91cc\u80e1\u54e8\u4e86\u5417\uff1f\uff1f\uff0c\u6211\u81ea\u5df1\u4e5f\u633a\u559c\u6b22 xshell \u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1328561\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ragnaroks <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u53ea\u6709\u6211\u662f\u5f53 cmd \u66ff\u4ee3\u7528\u7684?                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1328562\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Norie <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             win10 \u5c31\u662f\u6700\u597d\u7684 Linux \u53d1\u884c\u7248                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1328563\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lionseun <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @iamwho \u6211\u5c31\u662f\u7528\u8fd9\u4e2a                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1328564\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : godlovesxcjtest <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @lionseun #8 \u6240\u4ee5\u66f4\u6539\u5ba2\u6237\u7aef\u7684 ssh config \u53ef\u4ee5\u652f\u6301[xyz]Modem \u5417\uff1f\u5177\u4f53\u600e\u6837\u505a\u5462                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1328565\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ps1aniuge <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             ## \u76ee\u7684\uff1a\u6253\u5f00\u4e00\u4e2a\u65b0 win term \u6807\u7b7e\u540e\uff0c\u5219\u8fdb\u5165 linux \u79cd\u7684\uff0cpowershell \u8fdc\u7a0b\u547d\u4ee4\u884c\u3002<\/p>\n<p>## win term\uff1a<br \/>&#8220;commandline&#8221; : &#8220;C:\\Program Files\\PowerShell\\7-preview\\pwsh.exe -noexit -file d:\\ps \u811a\u672c\\ssh_to_ps62.ps1&#8221;,<\/p>\n<p>## ssh_to_ps62.ps1<br \/>param<br \/>(<br \/> [String]$\u76ee\u7684 ip \u5730\u5740 = &#8216;192.168.1.62&#8217;,<br \/> $\u7aef\u53e3 = 22,<br \/> $\u8d26\u6237 = &#8216;root&#8217;,<br \/> $ssh_key_\u6587\u4ef6\u8def\u5f84 = &#8220;$env:USERPROFILE.sshid_rsa&#8221;<br \/>)<\/p>\n<p>$msg = @&#8217;<br \/>\u9700\u8981 ssh.exe,\u4f4e\u7248\u672c win \u8bf7\u53bb\u8fd9\u91cc\u4e0b\u8f7d\uff1a https:\/\/github.com\/PowerShell\/Win32-OpenSSH\/releases<br \/>\u5efa\u8bae\u5728 Windows Terminal \u4e2d\u4f7f\u7528\uff1a<br \/>&#8220;commandline&#8221; : &#8220;C:\\Program Files\\PowerShell\\7-preview\\pwsh.exe -noexit -file d:\\ps \u811a\u672c\\centos7.ps1&#8221;,<br \/>&#8216;@<\/p>\n<p>Write-Warning $msg<\/p>\n<p>if ($PSVersionTable.psversion.major -ge 6)<br \/>{<br \/> Write-Host -ForegroundColor green &#8220;\u8fdb\u5165\u76ee\u7684 ip [$\u76ee\u7684 ip \u5730\u5740] &#8220;<br \/> Enter-PSSession -Session (New-PSSession -HostName $\u76ee\u7684 ip \u5730\u5740 -Port $\u7aef\u53e3 -UserName root -KeyFilePath $ssh_key_\u6587\u4ef6\u8def\u5f84)<br \/>}<br \/>else<br \/>{<br \/> Write-Error &#8216;\u9700\u8981 powershell \u7248\u672c v6 \u3002v7 \u66f4\u597d&#8217;<br \/>}<\/p>\n<p>##linux:<br \/>linux \u4e0b\u9700\u8981\u5b89\u88c5 powershell\uff0c\u5e76\u4fee\u6539 \/etc\/ssh\/sshd_config \u6587\u4ef6\u3002<br \/>\u4f7f\u7528\u8fd9\u91cc\u7684\u811a\u672c\uff0c\u53ef\u4ee5\u4e00\u952e\u5b89\u88c5\uff0c\u4fee\u6539\u3002<\/p>\n<p>https:\/\/gitee.com\/chuanjiao10\/kasini3000_agent_linux                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u4f7f\u7528 Windows Termin&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/89910"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=89910"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/89910\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=89910"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=89910"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=89910"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}