Contents
Why is SSH copy ID not automating?
Since they all have the same user/pass this should be easy but ssh-copy-id wants me to type the password in separately each time which defeats the purpose of my script. There is no option for putting in a password, ie ssh-copy-id -p mypassword user@myserver.
Why does RSA SSH keep returning invalid format?
Hope it helps. If you get a warning about an invalid public key format but the command still works then it may be because you only have a private key file and are using OpenSSH 8.3.
What to do if SSH key is not captured?
If no option is given, sshpass reads the password from the standard input. So, what you can do is to capture the password once during the script, store it in a variable, echo the password and pipe that to sshpass as an input.
How to revert changes to SSH _ config?
Revert changes to ssh_config if you are security conscious and restart daemon. I gotta say I am disappointed in most of you turning on Password Authentication is a MISTAKE DONT DO IT! Do this instead just create your user using root then sign in as the NON ROOT user using the su userhere command.
Where does SSH copy ID send public key?
Check out https://help.ubuntu.com/community/SSH/OpenSSH/Keys#Troubleshooting for an explanation and the required workaround. I would post this as a comment, but it would probably be too long. I just wanted to add that ssh-copy-id tries to send the public key from the /.ssh location inside your $HOME folder.
How to fix SSH prompts for a password?
One solution was to add manually on the remote server an SSH key which the SSH program tried to use. You can observe what the SSH program does when executing the command by adding -v to the command: Another, in my case better solution was to add a custom host in my local ssh config file.
Can you use expect in a bash script?
Mixing Bash and Expect is not a good way to achieve the desired effect. I’d try to use only Expect: This will wait for Enter and then return to (for a moment) the interactive session.
Is there a way to expect a SSH password?
Done! instead, as passwords starting with a dash (-) will fail otherwise. The above won’t interpret a string starting with a dash as an option to the send command. Use the helper tool fd0ssh (from hxtools, not pmt). It works without having to expect a particular prompt from the ssh program.