I have the the sms-to-shell [GitHub - itiligent/SMS-to-Shell: Secure remote control & interactive linux shell access over SMS. (Supports TOTP auth for remote shell commands)] working running via Crontab.
I am trying now to implement as systemd as recommended by David the program author. (If you are out there David, I joined Github but couldn’t figure out how to reach out for help there, so I am back here)
I am hoping someone can provide a bit of clarity by confirming my interpretation of what is happening in
sms-to-shell-setup.sh and sms-to-shell.service
Also any guidance - directly or via useful reference - on how to work in the root space. I have tried sudo , sudo su and su and find it a very unfriendly workspace. Im the Boss of the computer and it really doesn’t feel that way.
I think systemd has some big benefits and I would like to get it going.
I do understand that the sms-to-shell-setup.sh is a neat way to put everything in place.
So does the systemd .service file actually will look like this once the variables are applied?
[Service]
ExecStart=/usr/bin/python3
/opt/sms-to-shell/sms-to-shell.py
(Paul: This is were the py script is put?)
WorkingDirectory=$INSTALL_DIR
(Paul:# Is this /opt/sms-to-shell/
the outer directory of where the py script is??
Restart=always
RestartSec=5
User=‘root’
Additionally -
Does the actual systemd .service file go here like this?
/lib/systemd/system/sms-to-shell.service
Some questions i have:
a) How do I change the py script if I need to, with permissions being really stubborn in that folder ( /opt/ ) Definitely can’t do anything via graphical interface. Do I make a new version of script and ‘sudo cp’ overwrite it??
OR
Can I put the py script in one of my user folders where I can easily work with it or is root space better?
b) Should I change
SHELL_USER=“root” # Commands will run in this user context.
to
SHELL_USER=“Paul”
?
Any guidance is much appreciated.
Paul