首页 > 其他分享 >WSL: ssh localhost Permission denied (publickey)

WSL: ssh localhost Permission denied (publickey)

时间:2023-06-13 14:14:21浏览次数:27  
标签:Permission keys sudo WSL apt publickey ssh localhost authorized

If you're running Ubuntu on Windows Subsystem for Linux, there will not be a preinstalled public key or authorized keys list, so you'll need to generate your own.

If you don't already have openssh-server installed:

  1. sudo apt-get upgrade
  2. sudo apt-get update
  3. sudo apt-get install openssh-server
  4. sudo service ssh start

Then take the following steps to enable sshing to localhost:

  1. cd ~/.ssh
  2. ssh-keygen to generate a public/private rsa key pair; use the default options
  3. cat id_rsa.pub >> authorized_keys to append the key to the authorized_keys file
  4. chmod 640 authorized_keys to set restricted permissions
  5. sudo service ssh restart to pickup recent changes
  6. ssh localhost

标签:Permission,keys,sudo,WSL,apt,publickey,ssh,localhost,authorized
From: https://www.cnblogs.com/itkingyw/p/17477326.html

相关文章

  • WSL 配置代理
    在一个局域网下如果有一台机器配置好了代理,那么这个代理是可以共享给这个局域网下的其他设备的前置:防火墙关闭.zshrc/.bashrc里面配置exporthostip=$(cat/etc/resolv.conf|grep-oP'(?<=nameserver\).*')aliasvpn='exportall_proxy="socks5://${hostip}:7890";'#......
  • window11 下wsl 安装qt
    1、安装qt-creator命令行安装sudoapt-getinstallqt-creator2、安装qt版本参考qt官网安装步骤:https://wiki.qt.io/Install_Qt_5_on_Ubuntu选择了qt5.12版本 遇到的问题:找不到-lGl动态库解决办法:find/usr-namelibGL*ln-s/usr/lib/x86_64-linux-gnu/libGL.so.1/......
  • wsl2-ubuntu20.04从C盘迁移到F盘
    步骤1)导出到F盘2)从C盘中注销原始的ubuntu系统3)从F盘中重新导入wsl--exportUbuntu-20.04f://wslubuntu2004//ubuntu-20.04.tarwsl-l-vwsl--unregisterUbuntu-20.04wsl--importUbuntu-20.04f://wslubuntu2004f://wslubuntu2004//ubuntu-20.04.tar更多可参考......
  • Windows证书管理器 && SSL certification && WSL-Docker: curl: (60) SSL certificat
    深入浅出certmgr——Windows证书管理器https://www.fke6.com/html/91605.html计算机安全是当前社会的一个重要议题,证书是一种重要的安全机制,负责证明数据、软件或者人的身份和信誉。certmgr(即“证书管理器”)是Windows中专门用于证书管理的工具。本文将从多个方面对certmgr进行深......
  • windows 10 wsl 环境 docker 无法正常启动 -The system cannot find the file specif
    错误信息:errorduringconnect:inthedefaultdaemonconfigurationonWindows,thedockerclientmustberunwithelevatedprivilegestoconnect:Get"http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/containers/json":open//./pipe/docker_engine:Thesy......
  • wsl2支持linux gui应用
    网上说需要“安装VcXsrv或Xming”,其实现在的wsl2已经不需要了。只要win的版本够,并且升级wsl2到最新版本,就可以使用python的画图代码了。先决条件你需要Windows10版本19044+ 或Windows11才能访问此功能。已安装适用于vGPU的驱动程序若要运行LinuxGUI应用,应首先......
  • Linux 下启动jmeter 报-bash: bin/jmeter: Permission denied
    问题:通过cd进入jmeter目录中,执行脚本 bin/jmeter-n-txxxxx.jmx -l../50.jtl出现以下问题解决方法:修改文件权限chmod+xbin/jmeter修改后再次执行可正常启动 ......
  • Nginx出现403 forbidden (13: Permission denied)报错的解决办法
    一、由于启动用户和nginx工作用户不一致所致1、将nginx.config的user改为和启动用户一致,命令:viconf/nginx.conf二、缺少index.html或者index.php文件,就是配置文件中indexindex.htmlindex.htm这行中的指定的文件。server{listen80;server_namelocalhost;indexindex.p......
  • SELinux 影响 bash: Permission denied
    目录适用范围问题概述问题原因解决方案参考文档适用范围LINUX问题概述在客户环境中,我们会经常使用工具或脚本执行命令。但是在有的环境中,同的工具,同样的脚本有的执行成功,有的执行失败。在工具中我们执行"ps-ef|grepmysqld"查看进程的命令!在测试的时候却告诉没有权限执......
  • 如何在windows 11中安装WSLG(WSL2)
    什么是WSLWSL(WindowsSubsystemforLinux):Windows 系统中的一个子系统,在这个子系统上可以运行 Linux 操作系统。可以让开发人员直接在 Windows 上按原样运行 GNU/Linux 环境(包括大多数命令行工具、实用工具和应用程序),且不会产生传统虚拟机或双启动设置开销。什么是WSL2?W......