Sunday, May 5, 2024
57
rated 0 times [  57] [ 0]  / answers: 1 / hits: 270571  / 2 Years ago, mon, december 27, 2021, 3:10:56

I'm using Ubuntu 11.10 and ssh for connecting to many servers daily, so I put their parameters in the .ssh/config file like this:


Host Home
User netmoon
Port 22
HostName test.com

Is there a way to put passwords for each connection in this file, so that, when the server asks for the password, the terminal enters its password and sends it to the server?


I need this because sometimes I'm away from the PC and when I get back, type a password, and press Enter the terminal says CONNECTION CLOSED.


P.S. I don't want to use a public/private key pair.


More From » command-line

 Answers
1

Trading off security for convenience never ends well...



Could you use ssh-copy-id from the openssh-client package?



From man ssh-copy-id:




ssh-copy-id is a script that uses ssh to log into a remote
machine and append the indicated identity file to that
machine's ~/.ssh/authorized_keys file.



[#41445] Tuesday, December 28, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ionash

Total Points: 214
Total Questions: 111
Total Answers: 116

Location: Sudan
Member since Thu, May 7, 2020
4 Years ago
;