Forum Discussion

didou19's avatar
didou19
Level 0
8 years ago

pre-command with python script [TTY - ERROR]

Hello,

 

I'm trying to run pre-command/post-command with execution of python script on remote linux server.

But I can see many error on agent RALUS log (/var/VRTSralus/beremote.service.log):

sudo: sorry, you must have a tty to run sudo

sudo: sorry, you must have a tty to run sudo

sudo: sorry, you must have a tty to run sudo

 

When I'm trying to run my python script localy on my linux server its works well. I think the problem come from in the fact of the execution of the script is made by a real user when i do it in local (manually) and not from backup exec pre-command/post-command. 

By curiosity i've try to execute the python script from an other linux server through SSH Like this :

ssh XXXX@XXXXX 'symantec-script/test.py -c'
sudo: sorry, you must have a tty to run sudo

So can you tell me if we can force the pseudo tty allocation from symantec backup exec ? or the only workaround is to comment on my sudoers files the options : 

#Defaults    requiretty 

 

Do you know an other workaround on symantec side ? like an argument to put in the pre-command with my script path ?

Thanks for your feedback :)

2 Replies

  • Look at the -t and -tt options on ssh, one of those ought to do what you want.

    from the ssh man page:

         -t      Force pseudo-terminal allocation.  This can be used to execute arbitrary screen-based programs on a remote machine, which can be very useful, e.g. when implementing menu services.  Multiple -t options force tty allocation, even if ssh has no local tty.