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:
sudo apt-get upgrade
sudo apt-get update
sudo apt-get install openssh-server
sudo service ssh start
Then take the following steps to enable ssh
ing to localhost:
cd ~/.ssh
ssh-keygen
to generate a public/private rsa key pair; use the default optionscat id_rsa.pub >> authorized_keys
to append the key to the authorized_keys filechmod 640 authorized_keys
to set restricted permissionssudo service ssh restart
to pickup recent changesssh localhost
- Permission localhost publickey denied WSLpermission localhost publickey denied permission publickey coding denied permission publickey denied permission publickey denied github localhost password access denied permission npm publickey install permission repository publickey错误 密钥permission publickey变态 permission connect denied docker localhost ubuntu access denied