Sorry for the cross-posting across the fora. I am not sure if my original post was in the correct forum.
I am aware that what I would like to do is not safe...
I would like to open a window in my byobu session with root prompt. (i.e. with
sudo su -.) Once I get the root prompt, I would like to execute my script (
/root/command.sh)(as root) and then give me the root prompt again.
I can achieve the first part by putting the following line in my
new-window -n 'root' sudo su -;
send-keys, I can get the root prompt. However it is not executing the command.
new-window -n root sudo su -; send-keys mypassword C-m; send-keys source ~/command.sh C-m;
For some reasons it is not possible to use
visudo on these commands.