Gente,
Eu apenas instalei o ubuntu 16 e configurei um SSH. Eu estava depurando algo e acabei regenerando as chaves ssh, após o que ele começou a solicitar senha. Fiz alguns goggling e acabei fazendo ssh-keygen -A
executando o comando /usr/sbin/sshd -d -p 2222
deu um problema de aces, para o qual eu forneci 777 acesso a /etc/ssh/
Eu tentei regenerar as chaves ssh, mas retornei uma mensagem dizendo que a conexão foi redefinida
arjun@Arjun:~$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/arjun/.ssh/id_rsa):
Created directory '/home/arjun/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/arjun/.ssh/id_rsa.
Your public key has been saved in /home/arjun/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:wSoIm7jkD5InZmsaIxgEsBPffCdlMi20AITKs7tMzag arjun@Arjun
The key's randomart image is:
+---[RSA 2048]----+
|=oo...+.o |
|o+ o ..B. |
|*.. o +.+ |
|+B . . + . |
|=.+ . . S |
|+=+ . |
|XBoo |
|OB+ |
|E+.. |
+----[SHA256]-----+
arjun@Arjun:~$ sudo cat id_rsa.pub >> authorized_keys
cat: id_rsa.pub: No such file or directory
arjun@Arjun:~$ cd .ssh/
arjun@Arjun:~/.ssh$ sudo cat id_rsa.pub >> authorized_keys
arjun@Arjun:~/.ssh$ ssh localhost
Connection reset by 127.0.0.1 port 22
Também alterei o PermitRootLogin para sim em / etc / ssh / sshd_config