This question, in different forms, has been asked hundreds of times, and the answers are always similar - I agree with them in general case, but still would like to ask it again as my case is a bit different.

My workflow involves interaction over SSH with various devices manufactured by company I work in and I would like my SSH client to:

  • Remember the password for a host once I successfully login
  • Do not require me to manually delete entries from known-hosts file in case host identification changed.

The devices are always in an isolated, local network without internet access. I cannot use key-based authentication since these devices have no persistent storage (keys will not survive a reboot). I'd also like to use the same PC to access hardware in different setups - IPs and passwords are the same, but hosts IDs are different.

Regular, OpenSSH client is painful in this scenario - while I understand that's because of the security I'd like to voluntarily opt out of it.

Is this somehow possible without forking OpenSSH and making these changes by myself?

  • 1
    expect could be part of one of the solutions. – Rui F Ribeiro Mar 22 '18 at 12:58
  • What is the OS on your workstation machine? If *nix, check the StrictHostKeyChecking option in either /etc/ssh/ssh_config or your ~.ssh/config file. Also, some desktop environments will save password after first login during session - if your devices all end up with teh same username and password for access, this alone may work. if you are on Windows, not sure what can be done via putty.exe for the StrictHostKeyChecking equivalent, but I think that you can save a username and password in a "saved host config" option. – ivanivan Mar 22 '18 at 13:28

You might be able to achieve this by writing a script that first deletes the relevant entry from known_hosts and then runs ssh using expect as outlined in Shell Script for logging into a ssh server


1) passwords : you can change a boot image of this devices and write a key in it permanently , so you do not need to enter password ever . see if it possible ... not sure about which devices you use .

2) put a following code in ~/.ssh/config

     Host * 
        StrictHostKeyChecking no

this will set you up .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.