bash - how to run linux commands after logging into to a gateway controlled device -


i brand new linux/bash scripting , trying write script run commands on device connected gateway machine. script being run on gateway machine , device connected requires authentication. 1) ssh root@xyz 2) cd /mnt/abc/xyz 3) play command

1) runs , asks password , logs device, stops here , not run 2) , 3). how fix this?

i suggest setting passwordless login. http://www.linuxproblem.org/art_9.html

after that, put commands file commands.sh in root's home directory:

#!/bin/bash cd /mnt/abc/xyz play command 

then make file executable running command in bash:

chmod 750 commands.sh 

finally, can run remotely command

ssh root@xyz ./commands.sh 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -