Below you will find pages that utilize the taxonomy term “Bash”
SSH known hosts verification failure one liner
WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
Those who regularly build and rebuild machines or virtual machines on a dhcp network will probably be faced with this quite often, this is due to the known fingerprint for the previous host being different to a new one which has aquired the same IP address.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)! It is also possible that a host key has just been changed. The fingerprint for the ECDSA key sent by the remote host is c5:ab:00:3c:88:7e:18:8f:46:49:1d:af:f1:8b:4e:98. Please contact your system administrator. Add correct host key in /root/.ssh/known_hosts to get rid of this message. Offending ECDSA key in /root/.ssh/known_hosts:66 ECDSA host key for 192.168.1.165 has changed and you have requested strict checking. Host key verification failed.
rsync with spaces in filenames fun
While I was trying to copy a load of files from one server to another I found a problem I’ve seen time and time again, rsync with filenames that have spaces in them. While normally this can be easily fixed via number of methods:
rsync ‘jon@example.com:/remote/path/filename with spaces.txt’ /local/path/
Notice the quotes around the remote path, you can also use the -s (or –protect-args) which will send the command as-is to the remote.
Hourly Backup Script for Email
So I was working on a script a while ago to backup all my email on my Linux box. I put together a fairly simple bash script to delve into home directories and pick out the Maildir and back it up. Great!
DRIVE="/dev/sdb1" HOME="/home/" LIST="/tmp/backlist_$$.txt" # mount $DRIVE /backup set $(date) for DIR in `find /home/ -name “Maildir” -print`; do NAME=`echo $DIR|awk -F\/ {’ print $3 ‘}` tar vcfz “/backup/Mail/mail_full_${NAME}_$6-$2-$3.tgz” $DIR umount /backup