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
15
votes
3 answers

How does Android SuperUser app detect that an app requests root?

I'm writing an app that will use su to execute some commands in the linux kernel. I was wondering how SuperUser figures out that the application is asking for root privileges ? Also, are there any known ways (through obfuscation) in which this check…
asudhak
  • 2,929
  • 4
  • 22
  • 27
13
votes
3 answers

Read command output inside su process

firstly I will present my situation. I need to execute "su" command in my android app and it works well. Then I need to execute "ls" command and read the output. I'm doing it by getting the output stream from the "su" process and writing my command…
glodos
  • 1,203
  • 3
  • 13
  • 21
12
votes
2 answers

getting error while using "su" command

I try to make batch file to run adb commands. I want to use su -c, but I get the error: su: invalid uid/gid '-c'. I saw somewhere that my su version doesn't support -c, how can I enable this?
yehonatan
  • 203
  • 2
  • 3
  • 11
12
votes
3 answers

Rooted but su says "Permission denied"

I have this "old" Lenovo A2107 tablet which I rooted years ago (using a download from http://androidforums.com/threads/a2107-root-mods-and-rom-discussion.661261/, tho running its root.bat script by hand from my GNU/Linux machine) and that worked…
Stefan
  • 27,908
  • 4
  • 53
  • 82
11
votes
3 answers

How can i get default prompt and get rid of "sh-3.2#"?

Recently, i downloaded brew and npm to my reinstalled macOS, and now i noticed, when i write "su" command and write my password, i am getting this: su.png My problem is, I want to get old su prompt, how can i get it? I can't even remember what was…
user8087155
11
votes
1 answer

msysGit sudo-like command

If we open msysgit as administrator, we can use it as if we were root. However, it is often easier to open without administrator privileges. For example, for administrator privileges, you often have to go to Windows Explorer, the Start menu/screen,…
trysis
  • 8,086
  • 17
  • 51
  • 80
11
votes
1 answer

JSCH sudo su command "tty" error

Java - Jsch sudo command. I am using Jsch and my task is to login to server and run command as following sudo su - bumboo Using following code i am successfully able to connect but when i try to run command it gives me error sudo: sorry, you must…
d-man
  • 57,473
  • 85
  • 212
  • 296
10
votes
1 answer

Root privileges for an android application (Complete app. Not just few commands)

Question : How to execute one complete app with root previleges (not just few commands)? Scenario : I am working on a rooted android device. In an android app, I need to play the H.264 stream received through eth0. I need root privileges to open…
Sandeep
  • 18,356
  • 16
  • 68
  • 108
10
votes
3 answers

How does su work on android? And what are the pre-requisites for it to work? What is rooting on Android?

Possible Duplicate : what does the su mean: process = Runtime.getRuntime().exec("su"); I am tired trying all the different things yet i am still unsuccessful in understanding when will su work. What is rooting a device in Android? Someone please…
Sandeep
  • 18,356
  • 16
  • 68
  • 108
8
votes
1 answer

Can't run postgres on my system. It's showing `postgres is not in the sudoers file. This incident will be reported.`

I'm trying to install postgres on my WSL Ubuntu. Installation is finished but when I run psql the following error is displayed. psql: error: could not connect to server: could not connect to server: No such file or directory Is the server running…
yedukn
  • 93
  • 1
  • 1
  • 5
7
votes
3 answers

Root detection methodology in android which cannot be bypassed

I know that running an app which possess sensitive information on a rooted device is not secure at all. So developers usually do root detection in such cases and if the device is found rooted,then that app won't get installed. everything is ok. The…
Anonymous Platypus
  • 1,242
  • 4
  • 18
  • 47
7
votes
1 answer

scp file to different user in the remote server from local

generally, i login to a server xyz.com using my login credentials(myuserid@xyz.com), my home = /home/user/myuserid/ after login, i do "su - someuser" to access the files. i would like to copy a file from local machine to a directory in someuser…
sandeep vn
  • 83
  • 1
  • 1
  • 3
7
votes
2 answers

Bash script to test if a given user can read a directory and all files inside?

I need to test in a bash script if a given user can read a given directory with all files and sub-directories inside. The script runs as root. Assuming the given user name is $user and the directory to test is $dir I added the following line to the…
Michael
  • 41,026
  • 70
  • 193
  • 341
7
votes
2 answers

Switch to postgres user on Mac

I would like to su to the postgres user on Mac, so that I can run postgres. What am I doing wrong here? delirium:~ anna$ sudo su postgres delirium:~ anna$ Nothing happens. If I try to run postgres, I then get something like this: delirium:~ anna$…
flossfan
  • 10,554
  • 16
  • 42
  • 53
7
votes
1 answer

Android : programmatically copying apk to /system/app

I am trying to install a system app from my java code, and so far, I haven't had any success. Following is what I have done so far: My device is rooted. My "installer" app is installed as a system app. (copied it manually to /system/app) I have…
Chaitanya
  • 2,039
  • 4
  • 25
  • 32
1
2
3
30 31