Add new servers to known_hosts file automatically
When repomaker publishes a repo to remote storage, it uses SSH.
This requires the remote server to be in the known_hosts
file.
By default, SSH asks on the command line whether it should add the new server.
This doesn't work for repomaker, since it can not delegate this user interaction to the user.
Ideally, repomaker would add new hosts to the known_hosts
file automatically.
This might be achieved by setting the ssh option StrictHostKeyChecking
to no
.
From the SSH config man page:
StrictHostKeyChecking
If this flag is set to yes, ssh(1) will never automatically add host keys to the ~/.ssh/known_hosts file, and refuses to connect to hosts whose host key has changed. This provides maximum
protection against trojan horse attacks, though it can be annoying when the /etc/ssh/ssh_known_hosts file is poorly maintained or when connections to new hosts are frequently made. This
option forces the user to manually add all new hosts. If this flag is set to no, ssh will automatically add new host keys to the user known hosts files. If this flag is set to ask (the
default), new host keys will be added to the user known host files only after the user has confirmed that is what they really want to do, and ssh will refuse to connect to hosts whose host key
has changed. The host keys of known hosts will be verified automatically in all cases.
Prompted by #177 (closed)