Toggle navigation
主页
English
K8S
Golang
Guitar
About Me
归档
标签
Welcome to Sanger's Blog!
WSL问题
无
2023-04-19 10:58:21
13
0
0
sanger
[TOC] # WSL实现通过ssh连接 > 本文用的是microsoft store中下载的 Ubuntu22.x ## 配置好sudo ``` # # This file MUST be edited with the 'visudo' command as root. # # Please consider adding local content in /etc/sudoers.d/ instead of # directly modifying this file. # # See the man page for details on how to write a sudoers file. # Defaults env_reset Defaults mail_badpass Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin" # Host alias specification # User alias specification # Cmnd alias specification # User privilege specification root ALL=(ALL:ALL) ALL sanger ALL=(ALL:ALL) ALL # Members of the admin group may gain root privileges %admin ALL=(ALL) ALL # Allow members of group sudo to execute any command %sudo ALL=(ALL:ALL) ALL sanger ALL=(ALL) NOPASSWD: ALL # See sudoers(5) for more information on "#include" directives: #includedir /etc/sudoers.d ``` ## 安装ssh ``` apt remove -y openssh apt install -y openssh ## Ubuntu22.4 apt install -y openssh-server ## 启动ssh,并查看状态 /etc/init.d/ssh start /etc/init.d/ssh status ``` ## 实现开机自启 1. 通过`win+r`,输入`taskschd.msc`,进入**任务计划程序** 2. 点击**操作**后,再点击**创建基本任务** 3. **名称**任意写 4. 触发器选择**计算机启动时** 5. 操作选择**启动程序**,**程序或脚本** `%windir%\System32\bash.exe` ,**添加参数** `-c "sudo -S /etc/init.d/ssh start"`,然后下一步,单击完成 6. 进入任务页面,选择不管用户是否登录都要运行,输入密码完成配置 7. 重启验证
上一篇:
git配置密钥
下一篇:
iptables简介与常用命令
0
赞
13 人读过
新浪微博
微信
更多分享
腾讯微博
QQ空间
人人网
文档导航