How to ssh to localhost without password?

后端 未结 12 756
无人及你
无人及你 2020-12-07 13:05

EDIT: Putting exactly what was done

I need to SSH localhost without password, the usual way of doing it (with public keys) do not work.

user@PC:~$ rm         


        
12条回答
  •  太阳男子
    2020-12-07 13:53

    On Centos 7

    SOLUTION

    1 create rsa key
    2 vim /etc/ssh/ssh_config
    3
    #   IdentityFile ~/.ssh/identity
    uncoment this line > IdentityFile ~/.ssh/id_rsa
    #   IdentityFile ~/.ssh/id_dsa
    #   IdentityFile ~/.ssh/id_ecdsa
    

    Note *I did this after copying the key and some of the other answers before this one. But I am pretty sure this is all you have to do but if not I would append the rsa key to authorized_keys and also run the

    ssh-copy-id to username@localhost

提交回复
热议问题