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

learn more… | top users | synonyms

0
votes
0answers
13 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
30 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 ...
2
votes
1answer
30 views

Debian disable su to root user

I am currently using Debian 7 (Wheezy) and I am trying to disable the su command only when the target user is root and not a privileged user. For example, let's suppose the following users exist: ...
2
votes
0answers
97 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
3answers
221 views

How to login as root from Bash and do stuff

This is my simple bash: cat test.sh #!/bin/bash echo "hello" su - root -c /path/to/script.sh <<EOF password EOF whoami echo "good bye" But I get this error: ...
2
votes
1answer
79 views

difference between root executing command as sudo vs not using sudo?

I have a Linux question regarding the sudo command and the root user. If I log into the root user using the su command, what is the difference between the following two commands? root> sudo ...
1
vote
3answers
86 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?
0
votes
1answer
25 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
0answers
21 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 ...
9
votes
1answer
391 views

Debian - allow user to be root only for specific commands

We have several Linux boxes running Samba that are used 'locally', eg each branch gets their own Samba box to store and share files. The office managers need to be able to add and remove users for ...
1
vote
2answers
708 views

su & sudo on Mac OS X 10.9/Server 3.0

I am trying to use su and sudo on my iMac that I did a fresh clean install of Mac OS X 10.9 and Server 3.0. I explicitly set the password for root with passwd root but when I try to use su or sudo ...
1
vote
2answers
35 views

How to see history of commands entered as superuser

Is there a way to see the commands that I entered in su mode? Similar to the ~/.bash_history? Where would this be located?
4
votes
1answer
35 views

Why does cifs asks for su rights to write any data into it?

I'm mounting a windows share as follows: sudo mount -t cifs //192.168.178.49/public -o users,username=name,dom=domain,password=pword /mnt/nas Then I'm trying to create a simple file with some basic ...
1
vote
1answer
455 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
140 views

How to have a user who can 'su' to another user but not allowed to 'su' root

In my server, I have 2 groups: ssh-users and su-users ssh-users hold users I ssh to the box with. User sshu is a member of ssh-users. Once logged in to the server, I want ssh-users members to be able ...
1
vote
4answers
1k views

Alternative for sudo

I am aware that we can execute a command/script as a super/another user using sudo command. But Is there a possibility where the sudo utility itself is unavailable/removed by the user. If so, what ...
0
votes
1answer
352 views

How can I list all users who can su into a generic account

I have a generic account several users can su into, I however would like to find the name of all users who can do this. Thanks, Oscar
4
votes
1answer
77 views

Using su with commands

Ubuntu Server 12.04 On a remote server that I ssh into I have set up a special user with: sudo adduser --system --disabled-login --disabled-password --group suser to run some maintenance functions. ...
1
vote
1answer
841 views

su not working when non-root (authentification failure)

On a VPS I own (hosted at bluevm.com), I have three users: userone, with password foo, and sudo rights. usertwo, with password bar, without sudo rights. root, with now password (deleted with passwd ...
0
votes
2answers
357 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 ...
23
votes
3answers
1k views

Sudo su vs su linux

If I enter in the password to su when prompted, it doesnt work while sudo su does. Also, when a command is executed using sudo (command), does sudo automatically execute it by root by default (since ...
0
votes
1answer
105 views

Forgot su password at virtual machine?

I'm new to Fedora-17 and Linux. I've stumbled upon a problem after created my su password; I added some sequence and after this see prompt Setup is complete! But generally I didn't remember this ...
0
votes
2answers
473 views

How do I stop using root privileges?

I know this is extremely basic, but I am using Ubuntu Linux and I have just typed in sudo su I entered my password and performed the actions that I had to get done. Now how do I stop being root ...
4
votes
4answers
99 views

Any differences between `su` vs. `su -` beside the pathing? [duplicate]

I see that su - makes the shell a login shell from su --help. I'm curious what the differences are between this and a normal su command. I know there seems to be a difference in the paths, any other ...
3
votes
2answers
355 views

SSH as Normal User --> SU --> SCP as Root

I'm on a Win7 box connecting to a linux server. From reading: http://winscp.net/eng/docs/faq_su it looks like I need to open my SCP connections as the particular user. When I connect via SSH, I can ...
2
votes
2answers
2k views

Changed the permissions on /usr/bin

I executed sudo chown -R USER /usr/bin Now, when I try to "sudo" anything, I get sudo: effective uid is not 0, is sudo installed setuid root? I tried pkexec chown root:root /usr/bin/sudo and ...
1
vote
2answers
3k views

sudo to run command as different user

I am trying to setup a script that will be run as a "maint" user. The script is basically a menu that allows maintenance personnel to do different things on the server. However, some of the scripts ...
-1
votes
2answers
125 views

I can su to root, but sudo <command> fails

I am running Centos 5.3 and I can su to root fine. However when I run a command as another user like: sudo ls, the system says incorrect password for the same password. Why is this happening? Thanks. ...
5
votes
1answer
80 views

`su` for the OS X GUI

With OS X I wan the ability to log in to the computer as admin but set myself to another user on the system so I'm working on their profile with their privs, see all their settings, files, and run ...
0
votes
1answer
265 views

Difference between su command for Fedora and Ubuntu?

To log in as root while using Fedora I use : su and then enter the password. But while using Ubuntu this fails even if I use the correct password. But if I enter: su -s and then enter the ...
3
votes
1answer
199 views

solaris 8 init script asks for user password

I've got a script in the Solaris 8 initialization phase, under /etc/rc3.d, that contains a su - username -c "a command", but I see thru the boot messages that the su command is asking for the user ...
1
vote
1answer
273 views

Autologout after logging in

I have a Ubuntu 10.04 LTS server. I'm currently logged in as root, because I suddenly cannot log into my account anymore. When I execute su useraccount, nothing happens. The log file auth.log ...
1
vote
0answers
79 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
2answers
304 views

Stuck In su in CentOS 6

I accidentally did su with no arguments while logged into the root account. It then put me into su and at the beginning of the command line, it now shows -bash-4.1# How do I "get out of" su ...
0
votes
0answers
198 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
55 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 ...
0
votes
1answer
83 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
2answers
136 views

su misbehaves when executing a command that prompts for a password

I have 2 users in my debian server, gooduser and root. Command my_cmd prompts for a password (it connects to a ssh server). When I execute my_cmd as gooduser, everything works as expected: ...
2
votes
2answers
1k views

sudo, runuser, su don't work as I expect when run as root with command as “echo $HOME”

When I run these commands it outputs as shown. /root sudo -u someuser -i "echo $HOME" /root runuser -l someuser -c "echo $HOME" /root su - someuser -c "echo $HOME" /root What i expected was ...
0
votes
1answer
182 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
3answers
579 views

No access to root thru su

I'm trying to access my PC as root su and it doesn't says root@something it says mypcname username # vi /something/ and in the normal terminal display says username@mypcname ~ $ someone that ...
0
votes
1answer
76 views

Configure environment after running su without hyphen

How would you go about setting up the correct environment variables and any other settings that should be set when using the su - username command, but without the hyphen? i.e. If I use su - ...
6
votes
2answers
488 views

Is it possible for root to execute a command as non-root

I am root user and suppose i want to run any application as another user. is it possible, without switching to another user. Something like # google-chrome user=abc I am actually executing a cli ...
1
vote
3answers
954 views

Accessing an exit code outside of a su -m $USER -c “<cmd>”

The below command prints "0" or "1" correctly depending on failure or not because i put $? inside the "su" command. sudo su -m $USER -c "./shutdown.sh &> /dev/null; echo \$?" However, if i ...
2
votes
2answers
134 views

gksu is a front end to su?

gksu manual page says that it is a front-end to su, however su doesn't need a command to be executed, while gksu does. Also, gksu doesn't seem to change the user ID of my shell, while su does. Is it ...
7
votes
2answers
2k views

Can't write to file /sys/class/backlight/acpi_video0/brightness (ubuntu)

I am trying to change the brightness by overwriting the value on this file: sudo echo 5 > /sys/class/backlight/acpi_video0/brightness -bash: /sys/class/backlight/acpi_video0/brightness: Permission ...
3
votes
2answers
1k views

Supply SU password in a bash script, within the script?

The purpose is to restart the machine if it doesn't get an abort command from the user. The problem is that the way the terminals are set up, user must supply SU password for shutdown, init, reboot, ...
12
votes
2answers
3k views

What's the difference between “su” with and without hyphen?

I'm quite new to Linux terminal and I'm not quite sure what the difference between su with a hyphen and su without a hyphen is, for example: su - username vs. su username. I looked into the ...
0
votes
1answer
144 views

Cannot use `su` or `sudo` after set up key-based access to SSH

I'm following this tuturial to setup key-based access to the SSH I created a user. I add copy the key to the client via ssh-copy-id <username>@<host> Becasuse ssh ...
2
votes
2answers
353 views

Is there a way to remove root requirements for a specific command in linux? If yes, how so?

I'm using Ubuntu 12.04 LTS, and I'm trying to make it so that the specific command dhclient doesn't require root privileges. I've done some research that leads me to believe I could unlock an "su" ...