su

sudo hadoop vs su hadoop

十年热恋 提交于 2019-12-01 09:43:56
问题 Has anybody got into a strange environment issue and been forced to use SU rather than SUDO when calling hadoop commands? sudo su -c 'hadoop fs -ls /' hdfs Found 4 items drwxr-xr-x - hdfs hdfs 0 2014-02-11 12:33 /apps drwx------ - mapred hdfs 0 2014-03-10 10:25 /mapred drwxrwxrwx - hdfs hdfs 0 2014-03-10 10:26 /tmp drwxr-xr-x - hdfs hdfs 0 2014-02-11 12:34 /user The environment allows finding of the executable: sudo -u hdfs 'hadoop' Usage: hadoop [--config confdir] COMMAND where COMMAND is

Run shell commands from android program

旧城冷巷雨未停 提交于 2019-11-30 21:34:38
This question has been asked here before but the solutions provided are not working..I am trying to display the contents of /data/dalvik-cache folder. I know that to do this we need to become su. I even did that but still i am unable to execute a shell command.. package org.linuxconfidg.Example2; import android.app.Activity; import android.widget.*; import android.os.Bundle; import java.io.*; public class Example2Activity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); String

Changing to root user inside shell script

孤者浪人 提交于 2019-11-30 17:20:54
I have a shell script which needs non-root user account to run certain commands and then change the user to root to run the rest of the script. I am using SUSE11. I have used expect to automate the password prompt. But when I use spawn su - and the command gets executed, the prompt comes back with root and the rest of the script does not execute. Eg. < non-root commands> spawn su - <root commands> But after su - the prompt returns back with user as root. How to execute the remaining of the script. The sudo -S option does not help as it does not run sudo -S ifconfig command which I need to find

su postgres: Sorry? [closed]

南笙酒味 提交于 2019-11-30 01:02:20
i have a problem with my postgreSQL setup on my new Mac OSX Lion machine. I can't seem to connect to the service $ createuser -a -d _postgres Password: createuser: could not connect to database postgres: FATAL: password authentication failed for user I have no chance to find the correct password. Any idea what could that be. I have the default setup with a localhost server. The same happens when I try to connect via pgAdmin. $ su postgres Password: su: Sorry I have no chance to find out what's wrong? try this: $ sudo su postgres And specify your own password. Does this work? First get root

Changing to root user inside shell script

落花浮王杯 提交于 2019-11-30 01:00:28
问题 I have a shell script which needs non-root user account to run certain commands and then change the user to root to run the rest of the script. I am using SUSE11. I have used expect to automate the password prompt. But when I use spawn su - and the command gets executed, the prompt comes back with root and the rest of the script does not execute. Eg. < non-root commands> spawn su - <root commands> But after su - the prompt returns back with user as root. How to execute the remaining of the

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

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-29 01:00:33
问题 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 please help me with this. I replied to the following question. The solution i posted there, i tested and also it worked. Adding full permission for a image file in android. Here is my question : I tried Following. Copied su. Installed SuperUser.apk,

Force Close an app programmatically

那年仲夏 提交于 2019-11-28 22:09:32
I need to make an application that can programmatically do what the force stop button does to applications. (I am using root permissions) I have tried this code: private void killApp(){ try { int pid = getPid(com.XXX); if(pid != -1){ String command = "kill "+pid; Log.i("Got PID",pid + ""); try { Process suProcess = Runtime.getRuntime().exec("su"); DataOutputStream os = new DataOutputStream(suProcess.getOutputStream()); os.writeBytes(command + "\n"); os.flush(); Log.i("Executed","Kill " + pid); } catch (IOException e) { // Handle error } } else { Log.i("Not Found","App Not Found"); } } catch

su postgres: Sorry? [closed]

两盒软妹~` 提交于 2019-11-28 21:17:17
问题 i have a problem with my postgreSQL setup on my new Mac OSX Lion machine. I can't seem to connect to the service $ createuser -a -d _postgres Password: createuser: could not connect to database postgres: FATAL: password authentication failed for user I have no chance to find the correct password. Any idea what could that be. I have the default setup with a localhost server. The same happens when I try to connect via pgAdmin. $ su postgres Password: su: Sorry I have no chance to find out what

How to execute a group of commands as another user in Bash?

做~自己de王妃 提交于 2019-11-28 15:52:19
There are already some existing questions asked here about running commands as another user. However, the question and answers focus on a single command instead of a long group of commands. For example, consider the following script: #!/bin/bash set -e root_command -p param1 # run as root # these commands must be run as another user command1 -p 'parameter with "quotes" inline' command2 -p 'parameter with "quotes" inline' command3 -p 'parameter with "quotes" inline' There are a couple of important points to note here: The final three commands must be run as another user using su or sudo . In

JSch - How to issue commands as the user I have switched to

半城伤御伤魂 提交于 2019-11-28 13:07:58
I am using Jsch to remotely connect to a Linux server from Windows 7. I have to (i) login to Linux server with my credentials (ii) switch to root using a pmrun command [this is the procedure in our environment], and (iii) execute su command to switch as "someuser" (iv) execute further commands as that "someuser" I completed the steps (i) and (ii). After completing step (ii), the InputStream from the channel shows the command-prompt as that of the root user. So I assume that I have become the root user now. Now, do I need to get the root user's session to further execute an su command, or is