By default execute remote commands on Unix/Linux systems is as easy as type this code:

But sometimes the result is not the expected:

What is happening here is that sudo by default requires a TTY in order to works, but this behaviour can be changed at /etc/sudoers (use the command visudo for that purpose), changing the line:


So now, if we try again, probably we will get the following output:

This is because the user requires a password in order to grant sudo permissions, but we don’t have TTY to type it. The way to fix it is to modified the sudo entry at /etc/sudoers or /etc/sudoers.d/ to allow the user to make sudo without password.

Let’s try now:


In summary

So, in summary, the steps to follow are:

  1. modified /etc/sudoers  line Defaults requiretty by:

  1. Allow the user to do sudo without password:

That is very useful when we need to get information or execute some command quickly in a server, However from version 1.0.8  CollectNode works with sudo in a very easy way, making not necessary to do all this configuration.


Get CollectNode now !

Leave CollectNode to make the hard work, and spend your time where really matters.
Subscribe To Our Newsletter

Subscribe To Our Newsletter

Join our mailing list to receive the latest news and updates from our team.

You have Successfully Subscribed!

Pin It on Pinterest

Share This

Share This

Share this post with your friends!