The "substitute user" Unix command that changes the current user

learn more… | top users | synonyms

1
vote
3answers
395 views

How to exit the super user from middle of shell script?

I have a shell script in which most of the commands need to be run under sesu user and then I need to run some commands as current user. Can you please help me in this?
2
votes
2answers
1k views

How can I automatically pass the password to 'su'?

I am working on an exploit for a security course. The object is to obtain a root shell in a linux virtual machine. So far, I can write to /etc/passwd and change root's password to an arbitrary string. ...
0
votes
2answers
17 views

How to drop privileges in a script inside a non-interactive shell?

I'm using Docker to create images that I can run as containers. I'm configuring my image all as the root user, including setting up volumes and other things. But once I've got all that configured I'd ...
0
votes
2answers
825 views

Ubuntu cant login as super user Authentication failure,for a previously accessed password

i cant login as super user using su command ,previously it was successful and i am sure that password is correct,previosly there was an issue by changing file permission of www folder and i follow ...
0
votes
2answers
221 views

In Solaris how do you startup a script automatically without user input?

I'm using Oracle Solaris, and i would like to startup a script automatically everytime i turn on my computer and log into the desktop, however the script i want to run requires elevated permission, so ...
2
votes
1answer
34 views

In bash 4.3.27 “su” ignores user variables when combining “-” with “-c command”?

Since forever we used to launch user scripts from a different user crontab like this: 00 12 * * 1 su - user2 -c "/home/user2/myscript.sh" By doing this, the script is launched after the interactive ...
2
votes
1answer
427 views

“chmod -R 777 /” for a few seconds - now what?

On Centos 6.5 I accidentally typed chmod -R 777 / Ooops. I CTRL + C'ed out of it very quickly, but not before it'd started working away for a couple of seconds. Consequences? Well, already su ...
2
votes
1answer
1k views

SSH: remote switch user and execute command under this new user

I am able to connect to remote machine using public/private keys (without password) as user wakatana. On remote machine I am able to issue: sudo /usr/bin/rootsh -i -u root then I type root's password ...
0
votes
1answer
12 views

Difference between su and su -c (environment variables?) when running db2?

When I type this: su <user> -c "/home/<user>/sqllib/bin/db2 catalog tcpip node <dbName> remote <ip> server <port>" I get this error message: SQL10007N Message "-1390" ...
0
votes
1answer
72 views

Replacement for “su user_with_sudo; sudo -s” for user without sudo-rights?

Let's say I have two user accounts: user (without any sudo permissions) user_with_sudo (with all sudo permissions) Now, I'm logged in as user but want to do something as root, e.g. switch to a ...
0
votes
1answer
69 views

Difference between su vs root SSH login for mounting?

I have a bash script luks that I use in Android for mounting/umounting encrypted devices, that can be called in a terminal emulator with su -c "luks ..." The script works ok for the first part, ...
0
votes
1answer
42 views

Cannot access su in fedora 17

I am using Fedora 17. by mistaken, I have given full permission as root, for all the files in /usr/bin My command was chmod 777 * and also I gave full permission for a file(I can't ...
0
votes
1answer
116 views

Debian user keeps getting killed

I keep getting booted out of one of the user account on my Debian Squeeze server. At first I thought that it had something to do with SSH, but it still happens even if I log into another account and ...
0
votes
1answer
235 views

su - user is not doing anything

I am entering to an Ubuntu Server using root, and I need to run a background process as a more limited user, so I write su -l limitedUser -c 'programName' But nothing happens. Even if programName ...
0
votes
1answer
191 views

sudo makes me “lose” permissions when running a script?

I have a script that I need to run. It is kicking off a java program. When I run it as me, it seems to work fine. If I type "sudo myscript.sh" it does not run fine. In reality, I need to run it as ...
1
vote
0answers
888 views

What is the different between “sudo su” and “sudo bash”?

In Ubuntu 13.10, for the default setting, the following command in Terminal user@host:~/path$ sudo su results in entering an prompt root@host:/home/user/path# And this command ...
1
vote
0answers
97 views

OS X: change root umask for su?

In recent versions of OS X (10.6+), the sudo command by default takes the "union" (bitwise or) of 0022 and the caller's user mask. This can lead to problems if the umask is more restrictive than 0022: ...
0
votes
0answers
35 views

Windows equivalent of su

During start up, Group Policy can be used to run scripts before user log in. These scripts run as the local system account, which I understand to be effectively like root. I'd like to run a script as ...
0
votes
0answers
26 views

Trying to rsync and use sudo on other end

Scenario: Mac OS X Machine - old computer - user: john.doe Mac OS X Machine - new computer - user: john.doe Goal: Copy /Users/john.doe/Desktop and /Users/john.doe/Documents via rsync Problem: ...
0
votes
0answers
929 views

SU : Permission denied /bin/sh

I added a new user in system: $ useradd new_user When I try to switch from root to new_user, I get this error: $ su new_user permission denied /bin/sh $grep new_user /etc/passwd ...
0
votes
0answers
27 views

ec2 enable su for user ubuntu

I am trying to enable rstudio-server login with ubuntu on ec2, but it fails. I think it uses the same auth mechanism as su. So I did sudo passwd su someotheruser su ubuntu But even though I know ...
0
votes
0answers
109 views

Pip SSL certificates fail with sudo but not in su

When I pip install, I can download the package, but I have a failure in writing to files that are only accessible with privileged access. This is expected behavior. When I sudo pip install, I have an ...
0
votes
0answers
118 views

/etc/inittab combined with su - newuser failed to bringup new process with different UID than root

Using /etc/inittab on RHEL 6.3 x86_64 system, we tried to respawn a binary: aka watchdog from newuser UID login when restarted, not as a root UID process. Made the following changes as inline. ...
0
votes
0answers
29 views

deleted crontab on remote machine, but I don't know how

Here's the scenario: I have ssh access to internal.foo.com through bridge.foo.com. I wanted to make a local copy of the crontab from userx on internal.foo.com. My user has sudo access on ...
0
votes
0answers
276 views

Not able to log in as root in fedora 17

I am not able to log in as root in Fedora 17 Error is su: cannot set groups: Operation not permitted What to do to solve this error The permission has been changed to -rwxrwxrwx I want to ...
0
votes
0answers
58 views

Weird behavior of sudo

I use putty to log in to a remote LINUX machine. (Ubuntu 10) When I log in I have to authenticate myself, that goes on pretty smooth. Whenever I try to use sudo or su though, I experience ...