The problem is that I want to run certain ssh commands (Or scripts) from computerA to computerB without using a password.
Examples:
ssh apple@computerB 'poweroff'
ssh apple@computerB "killall firefox; systemctl enable apache; firefox"
ssh apple@computerB < superscript.txt
I also want to do this as secure as I can get it. I should not be able to ssh to computerB if I simply open up a terminal. And obviously not be able to edit the scripts/programs and run them afterwards.
I was thinking about using SUID and a different user with ssh keys to access the computer but there are security concerns regarding SUID and interpreted scripts.
Do anyone have any suggestions?