Execute local script on remote Linux host

后端 未结 2 1112
情歌与酒
情歌与酒 2021-01-06 02:34

I have a local script that will not run without root privs on the remote host. I have edited and allowed the sudoers file to run the script from the home dir (/home/username

2条回答
  •  太阳男子
    2021-01-06 02:48

    if you have sudo, AND allowed to sudo to root, then this works with a bit less syntax:

    ssh -T user@hostname 'sudo su -' < script.sh

提交回复
热议问题