Substitute User command

learn more… | top users | synonyms

1
vote
0answers
28 views

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

SSH tunnel to MySQL running on FreeBSD (Heidi SQL)

I'm trying to use a SSH tunnel to access a MySQL-server running on a FreeBSD 10.1 server. These attempts are done with Heidi SQL (http://www.heidisql.com/). The SSH daemon on the FreeBSD server does ...
-3
votes
1answer
64 views

can't switch to root or use sudo [closed]

I've just come into the following problem: For some reason I can't use su or sudo: usr@usr-MS-7816:~$ su Password: su: Authentication failure usr@usr-MS-7816:~$ sudo su [sudo] password for usr: ...
4
votes
3answers
578 views

SSH: su root or sudo? [duplicate]

What is the better option: Using su to switch to root or enabeling sudo? Without the use of sudo an intruder would need to know the password (or key) of a user allowed to ssh and then also the root ...
7
votes
1answer
676 views

su: /bin/bash: Resource temporarily unavailable

Unable to switch user to postgres. Ulimit settings for postgres user is set with reasonable limits. We are not hitting max. No errors in /var/log/messages. Error: BETA -bash-4.2# sudo su - ...
0
votes
2answers
259 views

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 ...
3
votes
3answers
2k views

Kernel Tuning with Privileged Docker Container

I'm building a container to tune kernel settings for a load balancer. I'd prefer to deploy those changes to the host in an image using a single privileged container. For example: docker run --rm ...
2
votes
1answer
93 views

Limit su attempts

Is there a way to limit the number of su attempts from a user? For example, malicious user gets into a user login that has su access. Repeatedly runs su to try to gain superuser access. This ...
0
votes
1answer
95 views

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

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

I am able to login to my server using WHM but when I SSH to a wheel group account I am unable to su to root [closed]

I have been having a problem over the last week or so executing an su - from a wheel group user account. I can log into WHM with the root password, but when I su - I get: [xxxxx@server public_html]$ ...
0
votes
1answer
27 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: ...
1
vote
1answer
417 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
525 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: ...
7
votes
3answers
5k 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
159 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 ...
3
votes
1answer
10k 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
85 views

Difference between su root and su -

What is the difference between switch users in linux with: su root and su -
3
votes
2answers
1k 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
1answer
167 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
2k 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
2k 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
197 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
127 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
531 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
142 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
1k 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
644 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
3k 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
82 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
377 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
1k 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
203 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
118 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
797 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
126 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
3k 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
315 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
924 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
4k 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
250 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
464 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
1k 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
3k 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
2k 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
965 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
706 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
966 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
99 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
251 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 - ...