0
votes
1answer
47 views

Difference between su root and su -

What is the difference between switch users in linux with: su root and su -
3
votes
2answers
97 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
2answers
70 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
2answers
214 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 ...
0
votes
1answer
51 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
137 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 ...
2
votes
1answer
815 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
102 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'
5
votes
1answer
619 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 ...
1
vote
1answer
558 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 ...
1
vote
1answer
486 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
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
197 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
3answers
75 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
423 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 ...
3
votes
5answers
4k 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
1k 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 ...
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 ...
10
votes
4answers
9k views

run script as user who has nologin shell

All I need to do is to run a specific script as a particual user who does have the nologin/false shell indicated in /etc/passwd. I would run the script as root and this should run as another user. ...
2
votes
2answers
2k views

Executing a command as a nologin user

I've recently set up my server so that my suPHP 'virtual' users can't be logged into by using this article My issue now is that before when I ran a rake command for my Ruby on Rails application ...
2
votes
1answer
2k views

/bin/su permission denied after SELinux is enabled - not resolved by manual creation of SELinux policies

For some reason, I can't su to root with from a non-root user: [rilindo@kerberos ~]$ /bin/su - -bash: /bin/su: Permission denied Running output from /var/log/audit/audit.log either returns this: ...
0
votes
3answers
138 views

Using su which user was I?

I use su when I often need to set proper permissions when copying files etc, but forget if I used su to get there, ex: root@host> su bob bob@host> copy folderA folderB But sometimes I forget ...
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 ...
7
votes
2answers
3k views

Run command as Linux “system” user (shell = /bin/false)

I created a "system" user in Ubuntu 11.04 (adduser --system) for running certain cron jobs, but sometimes I want to test things out by manually running commands as that user. What's the easiest way to ...
18
votes
2answers
4k views

Why does redirecting 'script' to /dev/null/ allow 'screen' to work while su'ed as another user?

I was su'ed into a user to run a particular long running script. I wanted to use screen but I got the error message "Cannot open your terminal '/dev/pts/4' - please check." So I Googled around and ...
28
votes
11answers
23k views

Linux: how to prevent a user from login in, but allow “su - user”

How do you allow a user to log in using "su - user" but prevent the user from login in using SSH? I tried to set the shell to /bin/false but the when I try to su it doesn't work. Are there several ...
2
votes
5answers
571 views

Why the same user has different PATH value on linux server?

I logged on to my Linux server (Redhat AS4) through SSH as the user 'guest', then run the command echo $PATH, and the output is /usr/local/bin:/bin:/usr/bin. However, when I run the command su - ...
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?