Binary in /usr/bin is invisible to user?

0

Situation

On a CentOS system, as root user, which rsync gives me the following output:

/usr/bin/rsync

The permissions of that binary are as follows:

-rwxr-xr-x 1 root root 415000 31. Okt 09:36 rsync*

If I understand correctly, this file is executable for its owner, the owner's group as well as for anybody else. However, being logged in as a regular user, which rsync gives no output and ls -l /usr/bin/rsync says:

/bin/ls: (...) No such file or directory

It is impossible to execute rsync – the command is not found, neither by calling rsync nor /usr/bin/rsync:

-bash: /usr/bin/rsync: No such file or directory

Trying to which rsync through an SSH tunnel:

$ ssh user@host which rsync
which: no rsync in (/usr/local/jdk/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin)
$ ssh root@host which rsync
/usr/bin/rsync

Question

What are the necessary steps to make /usr/bin/rsync executable for a given non-root user?

Further information (that may or may not be relevant)

  • This system is a remote server
  • I want to call rsync from a local shell script, like rsync [parameters] user@host:/some/dir .
  • The shell script will be run automatically and authentication of "user" will be done by SSH key

Update/Solution

Turns out I was mistaken and the system is running on CloudLinux, not CentOS. Apparently, CloudLinux allows to deactivate tools for regular users, which was the case for rsync. My apologies for the misinformation!

(Unfortunately, I can't tag this question with "cloudlinux" due to insufficient reputation.)

jgxvx

Posted 2014-03-13T14:21:00.470

Reputation: 101

Could you also give the permissions of /usr and /usr/bin? – user2313067 – 2014-03-13T19:01:30.847

Answers

0

Have you tried executing /usr/bin/rsync (not simply rsync) as the relevant user? That should give you a much better idea what's wrong: no such file, permission denied, or something else.

ls -l /usr/bin/rsync should produce some output, if only to say ls: cannot access /usr/bin/rsync: No such file or directory. If it prints absolutely nothing you might want to check whether somebody has fiddled with the commands - type -a ls and type -a which should tell you what you're actually executing.

Are you absolutely sure you are running the commands on the same machine? Try running the following commands:

ssh root@host which rsync
ssh user@host which rsync

l0b0

Posted 2014-03-13T14:21:00.470

Reputation: 6 306

My apologies, you are correct: ls does give the "No such file or directory" message. Unfortunately, it makes no difference whether I try to execute rsync or /usr/bin/rsync. – jgxvx – 2014-03-13T14:55:04.693

Thank you, I've added the output of the ssh commands to my question. Perhaps it is caused by WHM/cPanel running on that server. I'll open a support ticket with the hosting company and will update here if a solution is found. I thought this was a basic Linux problem, which is why I opened this question here. :) – jgxvx – 2014-03-13T15:18:30.783