Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have just installed an application on my Amazon EC2 instance called sshpass. I am having trouble getting it to work properly ( although, it works correctly on a non AWS instance ). I've read in some forums that I may need to run it as the root user for it to work properly.

On an AWS instance, I must run applications with sudo to run them as the root user. When I try to execute sshpass with sudo sshpass bash outputs 'command not found.'

Where & how do I configure sudo so that I can run sshpass as root using sudo?

share|improve this question

3 Answers 3

If bash prints "sudo: command not found" then sudo is simply not installed in your system. You may use su -c sshpass instead of sudo.

share|improve this answer

Depending on the type of image (Amazon Linux, Ubuntu, Suse, CentOS, Debian, etc...) you could find out the path where the files are installed, and run them, I assume the reason for this is the fact that the application is in /sbin or /usr/sbin and not in the default path of the non-root user.

To find the location of the files in RPM based distributions (such as, RedHat, Fedora, Amazon Linux, Suse and CentOS):

rpm -ql <your package name>

For Deb based distributions (Ubuntu, Debian) use:

dpkg -L <your package name>

In the listing you should be able to see the binaries in a path ending in bin or sbin.

share|improve this answer

Give the full path to the command.

E.g.:

sudo /opt/local/bin/sshpass

Obviously this isn't intended to be an accurate guess as to where you may have put it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.