su is a utility to run a shell or other command as another user (root by default).

learn more… | top users | synonyms

0
votes
1answer
18 views

adding a sudoer in debian

After a long search on the web, trying everything I can find I came to ask you guys, how can I add an existing user to be a sudoer? I've tried usermod -a -G sudo user and also adduser user ...
0
votes
1answer
26 views

Booted from NFS Linux has no permission for su command

I've booted Linux from NFS with Android system. And now I have to execute command as super use in minicom. But system doesn't allow me to switch to super user mode. Every time when I type: shell@...
2
votes
2answers
44 views

Command behavior is different when executed by an other user (via su -c)

I want to kill every processes who match a specific chain. Here is my script, which works pretty well: echo `ps aux | grep verySpecificChain | grep -v grep | /usr/bin/awk '{ print $2 }'` | xargs kill ...
2
votes
0answers
7 views

run gvfs-mount as user in a script owned by root for networkmanager dispatcher

I'm trying to create a script to auto mount using gvfs-mount for NetworkManager dispatcher. The dispatcher requires the script to be owned by root. Running gvfs-mount smb://path/ works in terminal as ...
7
votes
3answers
295 views

How to harden su with dpkg-statoverride?

I am reading an Ubuntu 14 hardening guide and this is one of the suggestions: It generally seems like a sensible idea to make sure that only users in the sudo group are able to run the su ...
2
votes
3answers
129 views

Why can I switch to a user but not run a script as it

If I try to switch to a user using command sudo su - kshitiz. It works fine and switches without asking for a password. But if I try to run a script as that user it asks me for a password. sudo -u ...
-1
votes
0answers
23 views

Unable to open software manager in linux mint with sudo/gksu

I'm unable to open software manager in linux mint. I open it and it asks for my password but after typing it, nothing pops up. When I try gksu mintinstall: I get on terminal Traceback (most recent ...
-1
votes
3answers
42 views

Run su -s with arguments

I run to run a command using the su -s command to start a process. Since I do not want the root user to own the process. I try to do this by issuing the command su -s "$CATALINA_HOME/bin/catalina.sh ...
4
votes
2answers
5k views

Unable to pass the password to su in a script

I am writing a build script. This script has to copy a file in the end. This file will be placed in another users home directory and it is also necessary that the file belongs to this second user. My ...
1
vote
2answers
759 views

Combined su and screen at startup

I want to start a long running custom script at boot. The script must run under a specific username. So far I have successfully used the screen command and switched to the user in the custom script. ...
2
votes
1answer
64 views

error thrown when using su -c: bash: no job control in this shell

I have written a script which should execute certain commands as another user and after execution is finished (success or failure) should logout immediately. I have read that I can use -c of su to ...
0
votes
1answer
44 views

Is it safe to uninstall `su` in favor of `sudo` to harden Arch Linux? [closed]

Is it safe to uninstall su in favor of sudo to harden Arch Linux? Have you got an opinion on whether this is a good or bad idea? I read the Arch Linux Wiki articles Security, Su and Sudo. I also ...
0
votes
1answer
26 views

Difference between su and su - [duplicate]

I wonder what's the exact difference between these 2 commands:1. su 2. su - . Can anyone please explain?
20
votes
2answers
57k views

su options - running command as another user

I was wondering how to run a command as another user from a script. I have the script's owner set as root. I also have the following command being run within the script to run the command as the ...
1
vote
2answers
595 views

How do you keep the password hidden when invoked during the su command?

This is the first time it has happened to me where I am using the su command and it actually displays the password on the terminal and doesn't stay hidden. Here is my code snippet: sshpass -p "...
1
vote
1answer
45 views

X11 forwarding via SSH and su

For me, it is weird that while using ssh connection with X11 forwarding, a user and root are able to see xclock, but another user is not able to see that. Why? mahmood@cluster:~$ xclock ^C mahmood@...
25
votes
4answers
40k views

“su” with error “X11 connection rejected because of wrong authentication”

As root, I'm connecting to a remote host to execute a command. Only "standarduser" has the appropriate id-file and correct .ssh/config, so I'm switching the user first: su standarduser -c 'ssh -x ...
3
votes
4answers
7k views

Allow paswordless user to change to another passwordless user

I have two users dev and tomcat neither of them have a password. How can I allow dev 1 do su - tomcat without having him having to enter any credentials? 1 connects with ssh keyfile
2
votes
2answers
14k views

can't ssh into remote host with root, password incorrect

I have a remote host, previously I can ssh into it with root and password ssh root@remote_host or I ssh into it first using a regular user account ssh esolve@remote_host and then su root and ...
1
vote
2answers
358 views

su -c command fails when sending db2 commands

I have a script I've setup to run a number of tasks, one of which is to set up a table in a DB and later remove it (for automated testing). The issue comes that on only a few of the users that I use ...
0
votes
1answer
26 views

Cannot switch to a non-admin user

Seems like I can't su unless the user is admin. When trying to ssh into the user or su username i get: Cannot execute /bin/bash: Permission denied Have tried almost every solution I could find on ...
13
votes
3answers
40k views

I Can't login as root with su command, but I can with SSH

How is it possible that I cannot log in as root by su root or su (I get incorrect password error), but I can log in by ssh root@localhost or ssh root@my_local_IP with the same password? I'm using ...
0
votes
0answers
18 views

su permision denied from terminal Arch linux [duplicate]

When I try to become super user (root) from terminal I receive permission denied, but when I try from tty console (press ctrl + alt + F2) I have access to root. My question is how can I receive ...
2
votes
2answers
5k views

Unable to su into an account: could not open session

in my Linux machine - red-hat I successfully to login to different users as the following su - userC [machine@Linux ~]$ pwd [machine@Linux ~]$ /Users/userC but only in one user I get the ...
2
votes
3answers
2k views

Why does sudo su work, but su does not? [duplicate]

I have tried this on Fedora and on Ubuntu. kshitiz@kshitiz:~$su su: Authentication failure kshitiz@kshitiz:~$sudo su root@kshitiz:/home/kshitiz# I am entering the same password in both the cases.
5
votes
2answers
257 views

How is the su command masking/protecting my password from being displayed on screen? [duplicate]

Apologies if this is an abstract question - I'll try to be as specific as possible. When I'm at the bash shell and switch to a different account via su - foo, I'm prompted for a password. The ...
0
votes
1answer
76 views

Allow multiple users to “su” to multiple other users without password

This is similar to this question: Allow user1 to "su - user2" without password However, the solution only work for multiple users accessing "su"ing ONE user. #works fine :) 2 or more ...
1
vote
2answers
68 views

Why does util-linux runuser (su) fork?

Using runuser from util-linux (a different entry point for su, which only operates if starting from root), one sees a process tree that looks something like the following: [root] runuser -u username ...
1
vote
0answers
37 views

Switching (su) to a paswordless account

I've made account A passwordless with passwd -d A. Now, when I log in as user B from a terminal and run su A I can switch to user A (and I am not even asked for a password). If, however, I log as ...
0
votes
1answer
34 views

command line in su - and background

I am writing a simple unix script to automate reading of a log file. The following does not give any output to the terminal. It just asks for the password for buser and then it just hangs. I ...
0
votes
2answers
78 views

How to use cd command in su command?

In the below script the cases aserver and bserver work fine. But in case "cserver" above, after su - gsxuserp, I need to perform the following three options with the same user. cd .. cd ...
0
votes
0answers
118 views

Unable to su to any user as root on Red Hat 6.7 server

System: Red Hat Enterprise Linux Server release 6.7 (Santiago) I am trying to su to kms user(OS user) as root but i keep getting error saying You are required to change your LDAP password ...
1
vote
2answers
102 views

Can't get user $HOME over su on Solaris and AIX

I'm trying to get user $HOME variable over su. Solaris # su oracle $ echo $HOME /root AIX # su oracle $ echo $HOME / Linux # su oracle $ echo $HOME /home/oracle Can someone explain why on ...
3
votes
2answers
3k views

su vs su - (on Debian): why is PATH the same?

I know what should be the difference between su and su -, but in my system (Debian) for example PATH is the same: [root]# su [root]# echo $PATH /user_path/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:...
4
votes
3answers
162 views

What exactly differentiates the root user from every other user?

What are the fundamental differences between some arbitrary account and root? Is it just the UID being something other than zero? So, what exactly does the su binary do and how does it elevate a user ...
1
vote
1answer
66 views

X11 authentication is not working in `sudo sux / sudo su`, but works in `sux / su.` Why?

I have a vnc session and I can access X11 just by doing su - user, for other user, without the need of sux. Also, when I am trying to switch to user, using sudo sux - user or sudo su - user, I can't ...
0
votes
0answers
75 views

debian 8 cinnamon file manager ssh as super-user

On a linux remote server I've a user who can become super-user without typing the password, e.g. simply typing sudo -s. Using winscp on windows there is an option to pass the sudo command (sudo su -),...
1
vote
0answers
42 views

Run mkvirtualenv command as another user

I want to run the "mkvirtual sth" but I have to run the script as superuser. sudo ./install.sh install.sh looks like this: # ... mkvirtualenv sth # su - geeret -c "mkvirtualenv sth" # (tried this)...
117
votes
6answers
41k views

Where did the “wheel” group get its name?

The wheel group on *nix computers typically refers to the group with some sort of root-like access. I've heard that on some *nixes it's the group of users with the right to run su, but on Linux that ...
-3
votes
2answers
84 views

How are setuid, suid, sudo, and su all related? [duplicate]

I have a feeling the setuid bit, the nosuid mount option, sudo, and su are all related given their names. But how do they relate to one another? Are some of them used in conjunction? If they are not, ...
0
votes
2answers
289 views

Run script on non-full bash-login invoked as “sh”

I'm currently trying to modify my terminal to have the prompt displayed in a different colour than the whole rest of the shell, and I would like to make it white for normal users and red for root. I ...
4
votes
3answers
31k views

Cannot connect to X server :0.0 as superuser

When I am online, I get following error and the tool does not start: [root@dhcppc9 lin64]# ./ise No protocol specified _pn: cannot connect to X server :0.0 But everything is OK when I am not a ...
3
votes
1answer
96 views

root cannot connect to symlinked socket of other user

I use oh-my-zsh's ssh-agent plugin to have a static symlink to my current SSH_AUTH_SOCK created. When connecting through SSH with agent forwarding enabled the file /tmp/ssh-agent-$USER-screen is ...
8
votes
2answers
9k views

How to run a GUI program as a different user (Debian)?

Using a terminal, I can change the running user with su and sudo — but how can I do that by clicking on an icon/shortcut on the desktop/start menu? If I have to be root to execute I will be asked ...
0
votes
1answer
22 views

X Forwarding over SSH when switching users [duplicate]

How do I forward X when switching users? I can ssh -X username@server.example.com and open GUIs just fine. However, then when I sudo su to root, the X11 forwarding seems to stop because the windows ...
1
vote
1answer
22 views

How (or is it possible) the Linux desktop X-Server from Terminal under an SU otherusername

I have a simple scenario to demonstrate the use-case for this question Login to Linux as currentuser start bash terminal xauth list $DISPLAY mint/unix:0 MIT-MAGIC-COOKIE-1 ...
7
votes
3answers
11k views

how to pass environment variable to sudo su

I basically need to do this: DUMMY=dummy sudo su - ec2-user -c 'echo $DUMMY' This doesnt work. How can I pass the env variable $DUMMY to su? -p doesnt work with -l.
0
votes
1answer
89 views

What's different between “su - username” then command and “sudo -u username command”

I have a problem about unixodbc. It show the error message about Can't open lib .... So, I use the ldd command to check. If I use su - username,the result like below: [root@ostest ~]# su - mysql [...
2
votes
1answer
87 views

When can a user do `sudo su` but not `sudo su -`?

The following happened to me: $ sudo su - superman Sorry, user clarkkent is not allowed to execute '/bin/su - superman' as root in krypton101. However the following worked fine: $ sudo su ...
13
votes
3answers
8k views

Difference between sudo -i and sudo su [duplicate]

I was wondering what the difference is between sudo -i and sudo su?