Substitute User command

learn more… | top users | synonyms

0
votes
1answer
15 views

Give su permission to LDAP group

I created an LDAP environment and i'm trying to set up a group in the LDAP server that has SU priviledges in all other linux machine that use this ldap server. dn: ...
0
votes
1answer
77 views

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 ...
0
votes
1answer
144 views

Centos : su: incorrect password after bash update

A few days ago I've updated the bash to patch it agains Shellshock and since then I cannot su - root from my regular 'wheelgroupuser' account on Centos 6.5 with WHM. I'm constantly getting su: ...
4
votes
2answers
246 views

Is “sudo su -” considered a bad practice?

Background I know the difference between su -, sudo su -, and sudo <command>: su - - switches user to root, requires the root password sudo su - - switches user to root, requires only the ...
1
vote
0answers
83 views

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 ...
1
vote
1answer
2k views

What's the difference between sudo su - postgres and sudo -u postgres?

PostgreSQL users peer authentication on unix sockets by default, where the unix user must be the same as the PostgreSQL user. So people frequently use su or sudo to become the postgres superuser. I ...
0
votes
1answer
58 views

Difference between su root and su -

What is the difference between switch users in linux with: su root and su -
3
votes
2answers
320 views

What is the difference between “su --command” and “su --session-command”?

Running # su - oliver --command bash gives a shell but also prints the warning bash: no job control in this shell, and indeed Ctrl+Z and fg/bg don't work in that shell. Running # su - oliver ...
0
votes
0answers
78 views

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 ...
0
votes
2answers
461 views

why does sudo su; su tomcat doesn't switch to tomcat user?

In Redhat linux. from my user if I issue command sudo su -> changes to root su tomcat --> changes to tomcat user Why does tailing the commands in single line doesn't work? sudo su; su tomcat --> stil ...
1
vote
5answers
919 views

How to run su from PHP launched on Apache? [closed]

I tried to run su command with PHP shell_exec function. At first I tried: <?php echo(shell_exec('echo \'password\' | su user -c \'whoami\' 2>&1;')); ?> and I got: su: must be run from ...
0
votes
1answer
122 views

Why can a local root turn into any LDAP user?

I know this has been asked here before, but I am not satisfied with the answers and don't know if it's ok to revive and hijack an older question. We have workstations that authenticate users on an ...
0
votes
1answer
88 views

sudo su in screen — security issue?

Just logged back into a server and reconnected to an existing screen using screen -R. I had completely forgotten that I'd used sudo su - earlier and had not exited afterwards, so when I reconnected ...
0
votes
2answers
357 views

running a remote shell script that switches to a user does not return to the issuing local server shell

When I run a script such as this: ssh -t root@10.10.10.10 '/tmp/somescript.sh' where the script is defined as: #!/bin/sh mkdir -p /data/workday/cred chown -R myuser:myuser /data su myuser - # ...
1
vote
1answer
87 views

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 ...
0
votes
1answer
580 views

sh bash script ambiguous redirect pid of file using single quotes

I have the following new line in my .sh file su --session-command='$javaCommandLine & >>$serviceLogFile 2>&1 & echo \$! >$pidFile' $serviceUser || return 1 When I had it ...
-1
votes
1answer
269 views

sudo to other user doesn't preserve DISPLAY variable

I've got an /etc/sudoers file that works just fine in all versions of Fedora prior to F18, but we've noticed that when upgrading to F18 (and installing FreeIPA, though the cases I'll show here were ...
0
votes
1answer
1k views

su: must be run from a terminal [duplicate]

I have tried to set up a scheduled backup of my Minecraft server. I used a script I found on GitHub at frdmn/minebackup.sh and it seems to work great when I run it from the terminal directly. The ...
0
votes
1answer
71 views

Proper way to switch users in sudoers

What is the difference between these 2 options in /etc/sudoers: user1 mymachine = (user2) ALL user1 mymachine = /bin/su - user2 For option 1, I would do the following as user1: sudo -u user2 -i ...
0
votes
1answer
196 views

Can't su to login on other user

I have a Debian server, and I can SSH to it.. On SSH there I'm prompted to specify username and pass, I can login here as any user I want.. If I'm root I can change to other users, for example with: ...
1
vote
1answer
622 views

“Session terminated, terminating shell…killed”

I have several boxen running Debian Wheezy. They appear to have the highly annoying problem that pressing ctrl+c in a shell that has been su:d to root will kill su, not whatever is running in the root ...
-1
votes
2answers
163 views

su command works without prompting password

I'm on a RHEL server where the su command drops the user into root without prompting for a password. Obviously, this is a pretty big cause for concern which I'd like to fix. I'm not in contact with ...
-9
votes
1answer
101 views

When I am root, how do I run one command as user “pi”? [closed]

When I am root, how do I run one command as user "pi"? Distribution Wheezy.
2
votes
3answers
530 views

Why is local root able to su to any LDAP user?

We have an LDAP server set up with our Active Directory. When users login to a Linux machine with LDAP client installed as root, they are able to su - into any Active Directory account without ...
0
votes
1answer
81 views

How can I have a deamon invoke scripts as another user?

I am configuring a server connected to an UPS. The UPS is managed via apcupsd and it calls some scripts when there is a power outage and when the situation goes back to normal. The server is running ...
2
votes
1answer
1k views

su between regular user accounts fails with “su: incorrect password”

user1 wants to su to user2 (both are non-root). When user1 runs su - user2, he's prompted for user2's password as expected, but the password is never accepted. user1@host $ su - user2 (switch ...
0
votes
2answers
149 views

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'
0
votes
1answer
589 views

sudoers nopasswd switch user and run node not working

I'm trying to prevent a password prompt on a command that runs node as the www user by adding the following line to the bottom of my /etc/sudoers file: gituser ALL=(ALL) NOPASSWD: /usr/bin/sudo -u ...
1
vote
3answers
2k views

Can't su to user other than root on CentOS

I'm able to SSH to my server (CentOS 5.9) using an admin account with sudo privileges: $ ssh admin@myserver Last login: Wed Feb 27 19:23:11 2013 from [IP ADDRESS] [admin@myserver ~]$ Then I can su ...
0
votes
2answers
167 views

Logout root after tmux detach

I'm running tmux on my servers and when configuring things I like to just su into root and take care of things. Is there a possibilty to log out root automatically after I detach the tmux session?
-1
votes
2answers
342 views

“su” does not work on FreeBSD

Below I sun "su" command on FreeBSD: FreeBSD rand.vstyle.local 9.0-RELEASE FreeBSD 9.0-RELEASE #0 amd64 This is server RAND :) [svn@rand ~]$ su logostudiotest1 /bin/ls Password: /bin/ls: /bin/ls: ...
5
votes
1answer
769 views

What's the difference between “sudo su -” and “sudo -i”? [duplicate]

Possible Duplicate: What is the difference between sudo -i and sudo su - I know both commands result in gaining a root-shell. But there are some differences. On some servers e.g. the prompt ...
3
votes
4answers
2k views

How to grant su access without password to one user only in wheel group (FreeBSD)?

I know how to enable su without a password for all wheel group users by adding the appropriate configuration line in /etc/pam.d/su. I do not want to enable this for all wheel users but only one ...
1
vote
1answer
850 views

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 ...
4
votes
3answers
655 views

Can I sudo a command on behalf of another user?

I'm using drupal and Aegir. Aegir automates many tasks of site creation. Aegir has control of Apache, I'm logen in as root, and I want to restart the Apache server, but I want to do it on Aegirs ...
1
vote
1answer
446 views

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 ...
1
vote
1answer
651 views

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 ...
1
vote
1answer
95 views

running commands as other users - best method

When running commands as other users from the command line, what is recommended best practice? In the past I've used sudo like so: sudo -u username command [args] I've been told (with no ...
1
vote
2answers
172 views

using screen in another user with su

So, if i do this: su -c 'screen -dmS screenname script to run' - user to run as It won't work. The screen command is working if excecuted from root, so there is no problem there. If I do: su - ...
1
vote
1answer
250 views

sudo rejects password that is correct

sudo (Which I have configured to ask for a password) is rejecting my password (as if I mis-typed it) I am absolutely not typing it incorrectly. I have changed the password temporarily to alphabetic ...
0
votes
1answer
257 views

running a command as root with /bin/su and without gives different results

Some background: I have a machine with SLES 11 installed. I am running a bash script that one of its lines is /bin/su $USER -c SOME_CMD. Unfortunately, the SOME_CMD that comes after the -c keeps ...
0
votes
3answers
80 views

Regular user doing su

I'm using Ubuntu server 12.04. If a user is only a member of it's own group why he can still do su SOME_OTHER_USER ? Can I prevent this?
1
vote
2answers
520 views

How can I create an “su” only user (no SSH or SFTP) and limit who can “su” into that account in RHEL5? [duplicate]

Possible Duplicate: How can I allow one user to su to another without allowing root access? We have a user account that our DBAs use (oracle). I do not want to set a password on this ...
2
votes
3answers
3k views

“Cannot set terminal process group” during su to another user as login shell

Note: Please read the updated information starting with "EDIT" near the halfway point of this post - the environment and background of this problem has changed I've got a bog standard Debian 6.0 ...
1
vote
1answer
49 views

Changed Password Won't seem to work for account

Bit of an odd problem. I've got a server I can SSH into as one of two logins: root or erik. Once I've logged in as erik I've tried to switch to the root user: # sudo su - root Password: And entered ...
0
votes
1answer
466 views

centos: su silently fails

On a CentOS server where I'm logged via SSH as root, I do: su otherusername where 'otherusername' is the user name of another user, which exists. It does nothing. After that, I'm still root. whoami ...
3
votes
5answers
6k views

run script as another user from a root script with no tty stdin

Using CentOs, I want to run a script as user 'training' as a system service. I use daemontools to monitor the process, which needs a launcher script that is run as root and has no tty standard in. ...
4
votes
3answers
4k views

BASH Scripting, su to www-data for single command

I am working on automating the creation of subversion repositories and associated websites as described in this blog post I wrote. I am running into issues right around the part where I su to the ...
4
votes
2answers
995 views

How to grant su access to wheel without asking for password on FreeBSD?

I would like to grant users of the wheel group (other sysadmins) su access without being asked for password. I know how to do it with pam in linux, but the question now is for FreeBSD. I am not ...
5
votes
3answers
2k views

SU and Run Command Using Expect

I want to su to another user, using expect, and then run a graphical program as that user. I am using kcalc to test with: #!/usr/bin/expect set timeout 20 spawn su dummy expect "Password:" send ...