Rafał Radecki
2016-Sep-06 10:18 UTC
[CentOS] Strange behaviour when using sudo+sh+executable.
Hi All. I am trying to install some software. Part of its installation is an invocation of command similar to: # sudo -H -E -u postgres /bin/bash -c /usr/bin/python2.7 /bin/bash: /usr/bin/python2.7: Permission denied>From my perspective:# ls -l /bin/bash /usr/bin/python2.7 -rwxr-xr-x. 1 root root 960376 Jul 8 2015 /bin/bash -rwxr-xr-x. 1 root root 7136 Oct 11 2015 /usr/bin/python2.7 # su - postgres Last login: Tue Sep 6 11:51:45 CEST 2016 on pts/6 -sh-4.2$ /bin/bash -c /usr/bin/python2.7 Python 2.7.5 (default, Oct 11 2015, 17:47:16) [GCC 4.8.3 20140911 (Red Hat 4.8.3-9)] on linux2 Type "help", "copyright", "credits" or "license" for more information.>>>I tried the same for /bin/top. From my perspective this is quite a strange behaviour. Can someone help with this problem? BR, Rafal.
Steven Tardy
2016-Sep-07 00:25 UTC
[CentOS] Strange behaviour when using sudo+sh+executable.
> On Sep 6, 2016, at 6:18 AM, Rafa? Radecki <radecki.rafal at gmail.com> wrote: > > # sudo -H -E -u postgres /bin/bash -c /usr/bin/python2.7Works for me. *shrug* Is your postgres user a service account or something else strange about it? Does 'passwd --status postgres' hint at anything?
Rafał Radecki
2016-Sep-07 06:15 UTC
[CentOS] Strange behaviour when using sudo+sh+executable.
At the end it was a sudo misconfiguration: Defaults log_year, log_host, loglinelen=0, logfile=/var/log/sudo.log, noexec This line with noexec was problematic ;) Thanks for the help! BR, Rafal. 2016-09-07 2:25 GMT+02:00 Steven Tardy <sjt5atra at gmail.com>:> > > On Sep 6, 2016, at 6:18 AM, Rafa? Radecki <radecki.rafal at gmail.com> > wrote: > > > > # sudo -H -E -u postgres /bin/bash -c /usr/bin/python2.7 > > > Works for me. *shrug* > > Is your postgres user a service account or something else strange about it? > Does 'passwd --status postgres' hint at anything? > _______________________________________________ > CentOS mailing list > CentOS at centos.org > https://lists.centos.org/mailman/listinfo/centos >