- Q. Why is my localexec SSH key not being recognized?
I followed the instructions in the Remote Storage document but all attempts to talk to the remote server return "command not found" errors. The system auth.log / secure log shows that the connection is being established between the two systems. It seems like the localexec command is not running on the remote server. What's going on?
A. To find out why you are having this problem it is important to first double-check your setup. Make sure your filecopy and localexec keys are correctly installed on the test server as well as the remote storage server. Use the --dump-config option in SysBackup to verify the SysBackup configuration and use the remote exec (remexec) test utility to try to run the local exec (localexec) utility on the remote server. Then check all the log files, including the /var/log/secure on Redhat-derived distros and /var/log/auth.log on Debian-derived distros. Don't forget to check your remote-exec.log and sysbackup.log files also.
If you are still getting "command not found" errors when running the remexec utility you should next check to see which key is being used to establish the SSH connection. If you are testing with an existing developers account and you have your usual keys loaded into the ssh agent the agent will present the keys to the remote server in the order that they are loaded in the agent. If one of the keys matches a key in the authorized keys file on the remote server the connection will be established - but the localexec command will not be executed.
Connect to the remote server directly with SSH. Use the verbose option (ie: ssh -v -i /etc/sysbackup/keys/localexec...) and search the resulting text to find out which key is being matched during the establishment of the SSH connection. You can also try emptying your agent using ssh-add -D to force SSH to use the key specified in the SSH command line (ie: the localexec key.)
Are you using SysBackup? Got any questions? Check this article for answers to questions that have been asked before.