0
votes
1answer
286 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
2answers
59 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 ...
0
votes
1answer
51 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
201 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
61 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 ...
-1
votes
1answer
113 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
50 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 ...
-1
votes
2answers
134 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
90 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.
0
votes
1answer
71 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
767 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 ...
1
vote
2answers
1k 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 ...
5
votes
1answer
604 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 ...
4
votes
3answers
551 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
91 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
1answer
193 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 ...
1
vote
2answers
418 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 ...
1
vote
1answer
47 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
2answers
807 views

Why does “sudo su - X” require password, but “sudo -u X bash” doesn't?

I know "why" questions are dangerous :) I have sudo access on RHEL, and noticed this: su -u fred su - Password: (I don't know fred's password). sudo -u fred bash [fred] $ Is there a way to not ...
2
votes
3answers
1k views

how to deny “sudo su”

I have several servers where some users require to be sudoers to work. The problem is that when sudoers can run the command sudo su and login as user root. It seems very risky to run that command. I ...
3
votes
2answers
987 views

How to su to another user in mac OS X?

I came from Linux world , and not familiar with OS X admin. Now I want to su to another user , but it just not working ... Where goes wrong here ? smallufo@miniserver:~ $ whoami smallufo ...
1
vote
1answer
3k views

Having users su/sudo in Linux based on Active Directory group when using pam_winbind

I'm using openSUSE 11.4 which has Active Directory configuration built-in to Yast (which does all the pam_winbind, Kerberos, nss, Samba-client stuff for you) and I can successfully authenticate ...
2
votes
2answers
302 views

The difference between su and bash

When I access the network server, I use the command sudo su to get admin privileges. Recently I found that sudo bash is the correct command and will allow me privileges those su does not. What is the ...
3
votes
3answers
249 views

What's the magic of the “sudo su”?

[demo@PHP_DEV_57 ~]$ sudo su [root@PHP_DEV_57 www]# Why I can switch to root by simply sudo su, what's the difference between sudo and su?
9
votes
8answers
18k views

using su inside of a shell script

I'm automating a deploy process and I want to be able to just call one .sh file on my machine, have it do my build and upload the .zip to the server and then do a bunch of stuff on the server. One of ...
3
votes
4answers
1k views

Configure sudo to ask for root password

Is it possibile to configure sudo to ask for root password instead of user password? The server is configured with a root user and a simple user (let's call him simple) with limited privileges, used ...
5
votes
2answers
3k views

should use sudo or just su root in server management?

Which approach is better? For desktop usage, it seems that sudo is better since: I can have a more consistent history as a normal user Don't need to remember two passwords, which is especially ...
3
votes
9answers
7k views

Disable su on machine

Is there a way to allow su only for specified users (like using visudo for sudo). The reason for this is I'd like to keep a simple (weak) password for my root account and have accounts that can ...
13
votes
4answers
3k views

Save file after forgetting to open as root / sudo vi [duplicate]

Possible Duplicate: vim re-edit as root I could have sworn I saw this question asked. But after looking though every search result for "vi" I'm stumped/lazy. I've opened a file, made an edit ...
3
votes
8answers
3k views

Linux - use “su -” but keep the current directory

When I do su - to get to root, my current directory is set to root's home. Is there anyway to keep the current directory that I was in, much like sudo -s. Or is the answer to use sudo?