The above addition would take the argument from the command (say, for example. So an addition to the bash script could look like: The command will run and add the remote SSH fingerprint to the local machine, without your input ( Figure B). To add that fingerprint, the command would be: Let’s say the remote server is at 192.168.1.162. I’ll demonstrate adding the fingerprint from a remote serve to a local machine. So what happens when you’re working with a bash script that cannot accept input, in order to okay the addition of the remote SSH fingerprint?įortunately, the developers of SSH thought of this, and have added a command that allows you to easily add SSH fingerprints to the known_hosts file. If you don’t accept the fingerprint, the connection will be immediately broken. When you log into an SSH server for the first time, you’ll see something like that shown in Figure A. What is an SSH key fingerprint? Simple: It is the fingerprint of a key that is verified when you try to login to a remote computer using SSH. When this happens, your script is rendered useless. When you run your script, it may get foiled by an issue where it is stopped by a server that has yet to have its SSH key fingerprint added to the known_hosts file. Such a file could contain the following contents: Let’s say you’ve written a bash script that scans all of your Linux servers in your data center for uptime. ![]() If your Linux shell scripts are getting tripped up by SSH fingerprints, Jack Wallen has an easy solution to avoid the problem. ![]() How to easily add an SSH fingerprint to your known_hosts file in Linux
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |