Questions tagged [su]

Substitute User command

Run a command with substitute user and group id, allow one user to temporarily become another user. It runs a command (often an interactive shell) with the real and effective user id, group id, and supplemental groups of a given user.

man page

126 questions
1
vote
1 answer

Why Apache can run a command and root cannot?

I have a server-side script executed by Apache running as www-data. The script runs fine on the server when called remotely (http://example.com/script.sh). I am trying to run the same script on the same server as root, impersonificating www-data. It…
WoJ
  • 3,607
  • 9
  • 49
  • 79
1
vote
2 answers

Allow www-data to use another user - sudo or ssh

I would like to allow my PHP script (hosted with apache2) to execute commands with another user account. I don't want another website hosted on the server to be able to connect to that another user account. If i add a rule in /etc/sudoers then it…
1
vote
0 answers

Automatically change remote user with sshfs

I have two remote servers, foo and bar. On both servers I have a user git (with different uid and gid). Both servers are running Debian distributions. Both servers have their each others' root ssh public key in authorized_keys, so all ssh-related…
Marandil
  • 111
  • 6
1
vote
2 answers

Linux-SSSD: always getting incorrect password when su'ing to domain users, but why?

I've built a new Linux environment at my work place. I've configured sssd and bound it to one of the Active Directory domains of the company. I can tell that the sssd is partially working, let me show you: I've cleaned the sssd cache on the local…
Itai Ganot
  • 10,644
  • 29
  • 93
  • 146
1
vote
1 answer

switch to a different user

I'm trying to SSH into a server then switch to a user named "jenkins". As you can see from the commands below, after I run su - jenkins I am still in the root user's home dir, and whoami indicates that I am still root, even though su doesn't return…
Dónal
  • 281
  • 6
  • 12
1
vote
2 answers

Linux: How to allow a regular user to "su - anotherUser"?

I wrote a Nagios check script which checks if user peeradmin is able to touch a file in some mount on the server. Nagios user is: nagios . I've edited /etc/sudoers and added these lines but none worked: nagios ALL=NOPASSWD: /bin/su - peeradmin -c…
Itai Ganot
  • 10,644
  • 29
  • 93
  • 146
1
vote
1 answer

su: Authentication failure

I have Ubuntu 14.04 server on which I can't use anything that relies on su. This manifests in inability to restart services or even switch users. root@ci-web1:~# su - mxx su: Authentication failure My /var/log/auth.log shows: Oct 10 11:14:15…
Mxx
  • 2,362
  • 2
  • 28
  • 40
1
vote
0 answers

RHEL Equivalent of AIX's chuser login=false rlogin=false

On AIX, I can disable login/remote login by setting the attributes listed to false, but I will still be able to su from other users, and sudo as the user. Is there an equivilant in RHEL to the above? I tried locking the password (usermod -L), and…
VTC
  • 11
  • 1
1
vote
1 answer

Reverse a command and disable su on Ubuntu

Whilst following an online guide on how to secure Ubuntu server, I ran this command on one of my test VM's. sudo dpkg-statoverride --update --add root admin 4750 /bin/su I know the intention of the command was to limit the use of su to specific…
Touff
  • 183
  • 1
  • 3
  • 14
1
vote
5 answers

How to run su from PHP launched on Apache?

I tried to run su command with PHP shell_exec function. At first I tried: &1;')); ?> and I got: su: must be run from a terminal Then I've read about spawning terminal with python's…
Patryk Hes
  • 43
  • 1
  • 1
  • 5
1
vote
1 answer

What are the most optimal permissions for /bin/su?

I want users to be able to use "sudo su -", but not to switch user by password. What are the most optimal permissions for /bin/su? Right now it's: -rwsr-xr-x. 1 root root 42436 Jul 26 18:19 /bin/su I was thinking about changing this to 700, is this…
ujjain
  • 3,983
  • 16
  • 53
  • 91
1
vote
2 answers

Running su with -c gives unrecognized command error

I am trying to run a command as another user in Linux. Here is what I run: su user1 -c '/bin/mkdir /tmp/zz' However, this gives me this error: fatal: unrecognized command '/bin/mkdir /tmp/zz'
user35042
  • 2,681
  • 12
  • 34
  • 60
1
vote
1 answer

Root SSH login works, but su/sudo to root does not work

Im recently working on a clients box, and SSH into the box with root credentials work but when i try to su or sudo to root user it states incorrect password. I tried changed the root password and know im typing it correctly. Thanks for help
Kwazii
  • 85
  • 1
  • 2
  • 8
1
vote
1 answer

Unable to su into any user

After I have fiddled with the folders /usr/bin, /usr/lib and /usr/lib64 I restored them, but was not able to su into root (and probably other accounts too): Permissions on the password database may be too restrictive This error shows only for…
1
vote
1 answer

Restrict su to domain user in Winbind/Kerberos Linux AD integration

We've got some RHEL 5 servers joined to AD using Winbind/Kerberos which is working well overall. I've specified an AD security group in PAM to restrict which domain users can login. auth requisite pam_succeed_if.so user ingroup ad_group…
kernelpanic
  • 1,276
  • 1
  • 10
  • 30
1 2 3
8 9