Problem: When running the ssh-keyscan
command in cron it emails me the output of ssh-keyscan
every day. The email simply contains the following.
# <hostname> SSH-2.0-OpenSSH_5.3
My (simplified) cron job:
host=`uname -n`
SSHKey=`ssh-keyscan $host`
echo $SSHKey >> /root/.ssh/known_hosts
My question: How do I prevent ssh-keyscan
from writing anything to the shell?