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

learn more… | top users | synonyms

1
vote
3answers
988 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. ...
1
vote
2answers
306 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
1k 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
236 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
76 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
1k 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
2k 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
42 views

How to switch user with pre-configured credentials in SSH Terminal after logging in as standard user

I am talking about authentication without needing user intervention like specifying password and username in the command file so that user don't need to input anything to switch user. For example: ...
0
votes
1answer
250 views

Require bash script to be run with sudo (not as root user)?

I want to require a bash script to be run as the current user with sudo, but prevent it from being run if it was executed as the root user directly. This is because I'm doing some setup actions for ...
0
votes
1answer
127 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
86 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
126 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
48 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
128 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
267 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
210 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
1k 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
120 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
19 views

PAM authentication problems with su - $username

When I try to su - postgres as the root user, I immediately get su: Authentication failure This is my pam.d/su file # Begin /etc/pam.d/su # always allow root auth sufficient pam_rootok.so ...
0
votes
0answers
19 views

Possible to su and run both .bash_profile's?

I currently log into the boxes at work, then: su - <adm_user> My question is, is it possible to pass through to the su'd user, my bash profile and source the adm_user's bash profile?
0
votes
0answers
18 views

Mounted Share from TerraStation file server - can't change file or directory permissions

I am trying to delete files from the TerraStation share in a subdirectory. These are marked by TS as having permissions issues. Through a terminal window (Mac, OS 10.10, CentOS) I su then cd to ...
0
votes
0answers
16 views

Cannot remove a file

I used Cryptonite to encrypt a file then my device was shutdowned suddenly. Well, I cannot decrypt the file anymore. This's what I catched in the logcat when I try to encrypt the file once again: ...
0
votes
0answers
45 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
36 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
1k 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
42 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
372 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
61 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 ...