'tramp never stops asking for password

I've having serious trouble using tramp on Emacs. I am continuously being asked for my password when I ssh into a server via tramp. This is to the point where it blocks me being able to do anything.

I have looked far and wide on the internet and the most widely used solutions do not seem to work for me.

Here is my tramp setup in my .emacs.d for the curious http://pastebin.com/NJCaa0RH.

Has anyone else had this problem and can point me in the way of a fix? Or do you see a glaring error in tramp config?



Solution 1:[1]

  • Make sure you can login via keys instead of password. This would involve copying ~/.ssh/id_rsa.pub or ~/.ssh/id_ed25519.pub from your local machine and pasting the same in ~/.ssh/authorized_keys on the server

  • Having a ssh config should help simplify the syntax

  • Having a persistent connection would also help with your problem

    (customize-set-variable
    'tramp-ssh-controlmaster-options
    (concat
       "-o ControlPath=/tmp/ssh-ControlPath-%%r@%%h:%%p "
       "-o ControlMaster=auto -o ControlPersist=yes"))
    

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Vasantha Ganesh