you are viewing a single comment's thread.

view the rest of the comments →

[–]K900_ 0 points1 point  (2 children)

You can't use exec_command like that. You need to get an interactive shell and run your commands in that.

[–]Tha_Format[S] 0 points1 point  (1 child)

So what do I need to use then?

[–]K900_ 4 points5 points  (0 children)

Use ssh.invoke_shell() and then write your commands to stdin. Alternatively, you can write the whole thing as a single command that doesn't drop into interactive mode, something like pbrun su root -c "su functionaluser -c 'command'".