Specifying password in .ssh/config file?

graywolf picture graywolf · Sep 6, 2016 · Viewed 24.1k times · Source

Is it possible to specify password inside my .ssh/config file? Something like

Host host1
    User user1
    Pass password

All resources I found recommend to use keys instead, but that's not an option for me, I want to use password.

If it's not possible with stock openssh, are there any patches laying around that would allow this?

EDIT: reason I need to use password is to get access to network drives when connection to cygwin sshd from linux.

Answer

Jakuje picture Jakuje · Sep 6, 2016

No, it is not possible. The configuration options are described in the manual page for ssh_config and there is no such option as Pass.

There are no patches (at least I didn't see any during the years yet), because it is very insecure to store passwords in plain text. Using some obfuscated method will not make it any more secure and real encryption would add here a lot of complexity (and a new encryption passphrase).

Really, use the SSH keys. They are cool, secure and easy to use. Just two commands to set up and third to use.

$ ssh-keygen -t rsa -P ""
$ ssh-copy-id server
$ ssh server