Questions tagged [su]

GENERAL SU SUPPORT IS OFF-TOPIC. Support questions may be asked on https://superuser.com. su is a utility to run a shell or other command as another user (root by default).

su is a Unix/Linux utility that runs a shell or a specified command as another user. By default, the other user is root, and su, with , is one of the two common ways of obtaining administrator privileges. Calling su usually requires typing the target user's password.

su originally stood for “super user” (it was only for running a root shell), and became later known as “substitute user” (or “switch user” or a number of similar backronyms) when it started accepting the target user name as an argument.

For system administration questions, see the su tag on Super User (for non-professionals), Server Fault (for professionals), or Unix & Linux.

460 questions
-1
votes
1 answer

Can I find which user ran a command using su?

Can I find who did run a command as a super user? I have the process ID and the super user id, but not the underlying human user.
Aniruddh Joshi
  • 1,705
  • 3
  • 12
  • 18
-1
votes
2 answers

What to use to SU to root from regular user for scp or sftp?

I want to connect to a server but I need to turn root to be able to copy some files. I use WinSCP, I heard that it's possible to become root just after the authentification but for a sudoer without a password. The problem is that I need to write one…
yolo
  • 67
  • 1
  • 8
-1
votes
1 answer

sudo password vs su password

My password for sudo commands works on my Mac, but it doesn't work for su? How can I reset (or find) my su password? I ask because I need to make my /data/db directory readable/writable for installing MongoDB and my sudo command isn't doing the…
lss111
  • 19
  • 2
-1
votes
1 answer

Scheduled Power Off and On feature

I have 2 phones- Karbonn and Micromax both has in-built feature- Scheduled power OFF and ON in setting where user can specify time for both events. I want this functionality on my Motorola too so that i can turn ON my phone whenever i want . Is…
Rohit
  • 810
  • 2
  • 9
  • 34
-1
votes
1 answer

How to run su in remote machine

I am running below command in host machine as root cat file1 | ssh remoteserver "su - differentuser;cat >> file1" It is not working. it is creating file1 in root home folder in remote server. But i want this to be created in different user home…
user3180371
  • 37
  • 1
  • 3
-1
votes
2 answers

Running su on Android root

Hi so my application runs some commands using the su in android root. It works fine in JellyBean on the Galaxy Nexus but when I try to run it on the LG Nexus 5 (kitkat), I get an error saying: su: uid 10069 not allowed to su I'm not really sure…
asm
  • 837
  • 1
  • 16
  • 41
-1
votes
1 answer

Change user with "su" locally without password for specific user

i have a Server with 4 users: a, b, c, admin I have the plan to enable user a and b to change to user admin with the command su (without sudo! [Because screen program]) without a password promt. I had read something about the /etc/sudoers file but…
fechnert
  • 1,215
  • 2
  • 12
  • 30
-1
votes
2 answers

Linux non-su script indirectly triggering su script?

I'd like to create an auto-testing/grading script for students on a Linux system such that: Any student user can initiate the script at any time. A separate script (with root privileges) copies student code to a non-student-accessible file space,…
ProfPlum
  • 129
  • 1
  • 8
-1
votes
1 answer

Cannon run executable app with su privileges

I want to run openvpn binary from command line in app on my rooted device. It's rooted alright (I checked it a few times already). I'm using Process process = Runtime.getRuntime().exec(cmd); For this, but on the very end I get error: Note: Cannot…
mglisty
  • 151
  • 2
  • 4
  • 15
-1
votes
1 answer

su -c in a bash script won't show any output

I've been scratching my head over this one for a while now. It seems so simple yet I just can't get it to work. This is on a rooted android tablet, if that makes a difference. I'm trying to imitate the behavior of sudo on a normal linux system. I'm…
cory
  • 341
  • 3
  • 15
-1
votes
2 answers

what are the correct file permissions for su and busybox on an unrooted android phone?

I am developing an embedded application and I need allow the device owner to root and unroot the device on demand. I am able to root the device by running the following shell commands through a special version of SU which is stored in the rom: chown…
LairdPleng
  • 948
  • 3
  • 9
  • 28
-1
votes
1 answer

su access android

I'm trying to make a file browser (specifically I started changing this: http://android-er.blogspot.com.es/2010/01/implement-simple-file-explorer-in.html ). My question is: How do I get access and see the files in the directory "/"? I found out…
ObiWan
  • 1
  • 1
  • 2
-2
votes
1 answer

-bash: /var/lib/rancid/.bash_profile: Permission denied bash command not found

-bash: /var/lib/rancid/.bash_profile: Permission denied bash command not found I am trying to switch between the users ( krypton & rancid) in ubuntu 16.04 with su - . A few days back it worked perfectly, but don't know what happened now. The…
Akhil
  • 1
  • 2
-2
votes
3 answers

how to use /dev/null for bash command

I am using below command to get result for my SQL query. su - postgres -c 'psql -d dbname' with stdin "COPY ( my SQL query ) TO STDOUT WITH CSV HEADER" This works fine on my server but on different machine it is printing bash warning with output of…
kd12
  • 1,291
  • 1
  • 13
  • 22
-2
votes
1 answer

Execute command if I logged in from a specific user

I have a server that has a superuser (user1) with special rights to perform certain operations. And there are some other system users. Is there any way to execute set of commands if and only if I logged in from system user (user2)? Or any way to…
Kaushal
  • 3,237
  • 3
  • 29
  • 48
1 2 3
30
31