Hello all. I'm in the process of trying to write a shell script for use from my Mister that will automatically transfer files from the SD card to a web server that I own. The server only allows connections via key pair, username/password authentication is disabled. I've got my key pair generated and the server is set up to allow them. I know they are correct because I can ssh into the mister and run the script from the command line:
./sftp_script.sh
and it authenticates properly and starts an sftp session. When I try to run the script from the mister UI, however:
System Settings->Scripts->sftp_script
I get a "Permission denied (publickey)" error. So there is something specific about running from the mister UI that is causing problems. I'm wondering if there are any linux and or mister gurus who can help me figure out what is going on. It looks like the script is run by the root user, same as when I run it when ssh'd in to the mister. I've checked file permissions, server logs and every stack overflow article I can find. Any help would be greatly appreciated. I'll attach the script itself as well as the error from the verbose command output.
Error:
debug1: Offering public key: /root/.ssh/id_rsa
debug1: Server accepts key: /root/.ssh/id_rsa
debug1: read_passphrase: can't open /dev/tty: No such device or address
debu1: No more authentication methods to try
Permission denied (publickey).
Connection closed