by Devin Yang
(This article was automatically translated.)

Published - 7 years ago ( Updated - 7 years ago )

When we use ssh to connect to the host for the first time, a fingerprint confirmation of the host key will be displayed.
Sometimes use rsync for some automated scheduling, maybe the remote host has changed and needs to be automatically allowed,
How to let ssh automatically allow fingerprints to connect without manually pressing yes in interactive mode?

The following example is to copy data from my computer to test-server, so the specified key is test-server.pem
The following is the Sample, when no parameters are added.. -oStrictHostKeyChecking=no
rsync -av --rsh='ssh -i ~/.ssh/keys/server.pem' vimrc/ ubuntu@test.example.dev:~/vimrc/
You can see that in the screen above you will be asked if you want to continue, here I answer "No".

Then, we have the same command, if we add -oStrictHostKeyChecking=no
There will be no yes/no pop-up, and the synchronization can be completed directly.
rsync -av --rsh='ssh -i ~/.ssh/keys/server.pem -oStrictHostKeyChecking=no' vimrc/ ubuntu@test.example.dev:~/vimrc/

Tags: linux

Devin Yang

Feel free to ask me, if you don't get it.:)

No Comment

Post your comment

Login is required to leave comments

Similar Stories


linux

How to install the monitor tool htop on CentOS

Htop is a free (GPL) ncurses-based program monitor tool for Linux. It is similar to top, but allows you to scroll vertically and horizontally, so you can see the full command line running on the system, And you can view them as program trees, select multiple programs and operate them.

linux

Generate ssh key pair without password query

Sometimes it is necessary to generate an ssh key pair for automatic configuration. There is no password query in the command line, and an ssh key pair is generated.

linux, python, colab

How to connect to colab from our Server through ssh?

Introduce a bash I wrote to connect to colab vm through ssh. One line of instructions, get colab OpenSSH Server.