Home Forums HAast (High Availability for Asterisk) Configuration & Optimization sudo error issuing ssh command from post-sync script Reply To: sudo error issuing ssh command from post-sync script

Telium Support Group
Post count: 263

First of all make sure you know which system is generating the error (the host running HAAst, or the host which the post-sync script is connecting to). That may change the answer, and/or where you need to apply changes.

One of these solutions should help:

  1. Try adding the “-t” parameter to the ssh command to create a pseudo terminal for the command to run in.
  2. Instead of “-t” try “-tt” to force a tty (even if ssh has no local tty).
  3. Remove sudo completely from the command in your bash script. Since the HAAst (service) runs as root the processes it forks also run as root (unless the system is further locked down). Assuming error is locally generated.
  4. Comment out the line “Defaults requiretty” in the /etc/sudoers file. Then sudo won’t require a TTY anymore for sudo commands. (But undstand security implications).
  5. Use the “su –c” command instead of sudo