File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ vscode 远程调试, 使用个人电脑,win10系统,访问远程服务器
88- linux 服务器配置 ` sshd ` , 一般都自带,这里不再赘述
99- windows 配置 ` sshd ` 服务, 需要单独安装,详见[ 安装流程] ( #install-sshd-on-win10 )
1010- 配置 本地 [ ssh config] ( #vscode-configure-ssh )
11+ - 配置 远端 sshd 服务[ 免密码登录] ( #win10-sshd-config ) , 这里给出了win10 的配置, linux 大同小异
1112
1213### install sshd on win10
1314
@@ -85,3 +86,26 @@ Host test_remote
8586` ` `
8687
8788然后点击远程资源管理器菜单(一个长得像显示器的图标),打开新的远程窗口,就可以开始愉快的 Debug 了, 进入远端后还需要安装相应的插件
89+
90+ # ## win10 sshd config
91+
92+ win10 配置 ssh 免密码登录:
93+
94+ 本地生成公钥 ` ssh-keygen -t rsa`
95+
96+ 复制本地公钥 ` C:\U sers\y our_userName\. ssh\i d_rsa.pub` 到远端服务器 ` C:\U sers\y our_userName\. ssh\a uthorized_keys` , 若文件不存在,自己创建
97+
98+ 修改配置文件: ` C:\P rogramData\s sh\s shd_config` 设置密钥登录
99+
100+ ` ` ` sh
101+ # 确保以下3条没有被注释
102+ PubkeyAuthentication yes
103+ AuthorizedKeysFile .ssh/authorized_keys
104+ PasswordAuthentication no
105+
106+ # 确保以下2条有注释掉
107+ # Match Group administrators
108+ # AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys
109+ ` ` `
110+
111+ 修改完成后,重启远端` sshd` : ` Restart-Service sshd`
Original file line number Diff line number Diff line change @@ -69,3 +69,14 @@ da830267-f747-4474-9f1d-d096f7535d1d
6969## beautify
7070
7171[ Windows Terminal美化界面] ( https://juejin.im/post/6844904116322304014 )
72+
73+ ## sudo
74+
75+ 使用 ` gsudo ` 像 Linux ` sudo ` 一样 开启管理员权限
76+
77+ ``` sh
78+ # install
79+ PowerShell -Command " Set-ExecutionPolicy RemoteSigned -scope Process; iwr -useb https://raw.githubusercontent.com/gerardog/gsudo/master/installgsudo.ps1 | iex"
80+ # using
81+ gsudo powershell
82+ ```
You can’t perform that action at this time.
0 commit comments