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
0
votes
2 answers

Why program still don't take screenshot after getting "su"?

I push the button and program get SU, but png file is 0 bytes weight. Logcat says Permission denied: can't read framebuffer pid=12844 uid=10087. So why that's so. My phone is rooted, program already get su. What's wrong? Button btn = (Button)…
0
votes
3 answers

Executing db2 command through ssh

trying to ssh to another system then perform db2 commands however using 'su db2admin -c' does not seem to work, although it works for normal system commands .. #!/bin/bash sshpass -p 'passw0rd' ssh root@server.com "su db2admin -c 'db2text…
bobbyrne01
  • 6,295
  • 19
  • 80
  • 150
0
votes
1 answer

'su' command issue while executing through android application

Hi I'm trying to execute the 'su' command as following via an app. Process process = Runtime.getRuntime().exec("su"); process.waitFor(); Log.d("EXITVAL",Integer.toString(process.exitValue())); I'm getting exit value 1 ..Its returning 0 for other…
srooth
  • 33
  • 2
  • 11
0
votes
1 answer

Why do some commands require locks on Unix and others don't?

Recently, I'd been observing something interesting on our environment AIX 7.1. In an attempt to track down the issue, I created a small locking application in Java: import java.io.File; import java.io.RandomAccessFile; import…
WilliamMartin
  • 553
  • 5
  • 15
0
votes
1 answer

Missing matching quote with su -c in bash script

I want to write something like EXEC="sudo su -m root -c \"java Something\"" $EXEC & But i get the following error: Something": -c: line 0: unexpected EOF while looking for matching `"' Something": -c: line 1: syntax error: unexpected end of…
0
votes
2 answers

Cannot get permission prompt from SuperSU

I have an app which should execute some root commands. SuperSU version is 1.04. Su version is 1.02. Android 4.1.1. Device is Samsung Galaxy S3 - rooted. The problem is I cannot get a permission prompt from SuperSU. I've tried many things, but prompt…
0
votes
2 answers

How can I see the loggedin users that have used 'su'

If I use a login shell to login as root then 'who' or 'users' commands will show an entry for the root user. However If I login with user1 and then use: 'su - root' Then the 'who' and 'users' command will not show an entry for root. Is there a way…
Marinos An
  • 9,481
  • 6
  • 63
  • 96
0
votes
0 answers

How to execute code as other user within script?

I'm writing a script which automates the install of a mailserver, however some of my code has to be compiled from source because it is not in repositories. I have no problem with this, however, I have no idea what the best and most safe way is from…
Peter van Arkel
  • 519
  • 1
  • 5
  • 14
0
votes
0 answers

Trouble with RunTime.exec("su")

I would like to run some shell command from my application but when i run : Process process = Runtime.getRuntime().exec(su); I have got an error : su: uid XXXXX not allowed to su. I do not understand why because I think my phone is rooted as in…
Luciflore
  • 11
  • 1
0
votes
2 answers

SUDO - iOS FTP - Stuck

I have a script for MobileTerminal in iOS that requires su, is there any way I can add a command to the bash script to login as root without having to type su then the password? Cheers, Dec
Declan Land
  • 17
  • 1
  • 7
0
votes
0 answers

Copying to /system - android

I am been trying to copy a apk from assets of another apk to /system. Here is what I have done,it was working in my previous app but not in this.I have added permission for wrtiting external storage. It is successfully copying to internal…
Neal
  • 131
  • 2
  • 3
  • 9
0
votes
2 answers

What does this command means "-c"?

I was looking at some codes, and found this code { "su", "-c", "reboot" } I know that this will make your phone to reboot, because it ask for su first then reboot, but I don't know what that -c means. Its like an enter button on the keyboard? also…
Rotary Heart
  • 1,899
  • 3
  • 29
  • 44
0
votes
3 answers

OpenLDAP The LDAP server is unavailable

I have been trying to connect to our OpenLDAP server from asp.net for the last four days without success. Just before I pull off my hair, could any one out there have a solution that has worked( ie using c# asp.net to connect to OpenLDAP server).…
john
  • 1
  • 1
  • 1
0
votes
2 answers

Changing unix user in a shell script

I want to change the current user in a shell script in order to give the user the ability to execute the commands as an administrator, by passing the login and password as arguments. I want to have the ability to do something like : sh ./script.sh…
Yassir Ennazk
  • 6,970
  • 4
  • 31
  • 37
0
votes
2 answers

Java execute Linux commands that require su?

What is the best way to run Linux commands that require "su" with Java? I want it to be very reliable, as for security goes I don't care much about it the system is not a production server. No one ever connects to the machine but myself. I thought…
Arya
  • 8,473
  • 27
  • 105
  • 175