Thanks to the sharp eye of @roaima it has come to my attention that my remote server backup script below, does NOT actually use the SSH encryption as I would like it to.
I based my rsync command on the example found here:
https://www.man7.org/linux/man-pages/man1/rsync.1.html
rsync -av -e "ssh -l ssh-user" rsync-user@host::module /dest
However, what is actually happening when my current backup script executes is:
1.) it connects to ssh as the designated user, then
2.) my login notification script confirms the ssh user's login with an email (repeats on disconnect/re-connects),
3.) PROBLEM: The rsync daemon connects and does its business -outside- the ssh shell, meaning I don't actually get the ssh shell encryption that I want.
I verified this by executing the backup script and then on the remote server executing the who command, which confirms that the ssh-backup-user is -not- connected to the server while the rsync daemon is executing.
My current backup script (has to executed as non-root user)
#!/bin/bash
while [ 1 ]
do
rsync -avxP --delete --append --checksum --timeout=180 --bwlimit=150 --rsync-path="sudo rsync" --log-file=/var/log/rsync.log --password-file=/etc/rsyncd.passwd -e "ssh -l backup-user" 111.22.333.444::data /media/user/WebMade/Server-Backups/Prod/today/
if [ "$?" = "0" ] ; then
echo "rsync completed normally"
exit
else
echo "Rsync failure. Backing off and retrying..."
sleep 10
fi
done
#EOF
Might someone be able to clarify whats happening, either I am misunderstanding the man page (most likely :-/ ) or the provided example is wrong.
Thanks
whodoes not confirm that, because it doesn't list non-interactive SSH sessions such as those used by rsync. Even if rsync were transfering data over SSH, you would not see it in that way.whois not the appropriate tool to check for this. Then how? Good question; at times I've verified this withtop. rsync transfering with 80MB/s? ssh consuming 60% CPU? Seems to check out.