473,698 Members | 2,243 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

su version of sudo -s

computerfox
276 Contributor
Hello everyone,

My question is a weird one, but here goes. I'm trying to run a system command in an iPhone app similar to echo <password>|su do -S <command>. The problem is that the iPhone doesn't have sudo. Is there any way I can use su or write a script where it expects the password through stdin? Yes, I know this is a dumb request that is not an Apple standard, but I would like to do this for my own understanding. I can run the command easily on the simulator (because it's essentially using the Mac OS environment) with the sudo approach, but I need to implement it using the su command.

Any ideas?
Feb 17 '13 #1
1 1454
Nepomuk
3,112 Recognized Expert Specialist
I have not tried this on an iPhone, but in general
Expand|Select|Wrap|Line Numbers
  1. su -c 'echo `whoami`'
should run the command echo `whoami` as root. Can you use that?
Apr 29 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

16
2746
by: Manlio Perillo | last post by:
Hi. I'm a new user of Python but I have noted a little problem. Python is a very good language but it is evolving, in particular its library is evolving. This can be a problem when, ad example, a module change its interface or its implementation in a fundamental way (an example: wxPython). This, I think, can be resolved by allowing an user to explicitly say what version of a module it wants (sush as version numbers in Linux shared...
2
3736
by: Tim Daneliuk | last post by:
Given that setuid is a Bad Thing for scripts, what is the general consensus here on running a Python script via 'sudo' to give it root system access? Is this reasonably secure, or am I still asking for trouble? TIA, -- ---------------------------------------------------------------------------- Tim Daneliuk tundra@tundraware.com PGP Key: http://www.tundraware.com/PGP/
5
7415
by: slava | last post by:
hello, i am writing a python script that will be run by a non root user the script needs to open a file in write mode that is owned by root file = open('/etc/apt/sources.list', 'r+') returns permission error how can i call sudo on open()?
3
3064
by: Shadow Lynx | last post by:
At the bottom of the default Error page that appears when Unhandled Exceptions occur, what exactly is the difference between the "Microsoft ..Net Framework Version" and the "ASP.NET Version"? I understand that the ASP.Net version is the version of ASP.Net that the current site is running under and it can be retreived with System.Environment.Version.ToString. What exactly is the Microsoft .NET Framework Version that is displayed? It is...
2
1777
by: Hongbo | last post by:
Hi, I have a web site built in ASP.Net 1.1 running on production server. It's the version 1.0. Now I need to build the version 2.0 for this web site. The version 2.0 will be built based on the code of version 1.0. Since it take some time to have the version 2.0 ready for production, the code of version 1.0 needs to be kept somewhere for possible bug fix. At this point, the only feasible idea I have is: 1) create a new project for...
0
1921
by: ev951 | last post by:
I am not that familiar with XML or XSL and I am trying to sort application version number strings in an XML file that my team uses for application installations on our Linux servers. I have tried the xsl:data-type=number, but that doesn't work. The output of the XML file is exactly what the XML file has and I would like to sort it by the number value. Below is the some of the output from the XML file. <?xml version="1.0"?>...
0
2160
by: dwelch91 | last post by:
I'm having a problem using pexpect with 'sudo' on Ubuntu 6.06 (Dapper). Here's the program: #!/usr/bin/env python import pexpect import sys child = pexpect.spawn("sudo apt-get update") child.logfile = sys.stdout
3
1735
by: swapnniil | last post by:
Hello friends, i had been trying for sudo-ku for long time but was unable to code it.It will be nice if any one could help me out.
4
10179
hsn
by: hsn | last post by:
hello everyone. i am trying to run the sudo -i command in my mac. here is the code String s = null; try {
1
3618
by: prasadshete | last post by:
Dear all, my system is $ uname -a Linux DLidps01 2.4.21-4.ELsmp #1 SMP Fri Oct 3 17:52:56 EDT 2003 i686 i686 i386 GNU/Linux 1.Now, i my a/c has sudo to root access. i do $sudo bash and enter into the root. But nowadays i am not able to do so. here is the error message.. $ sudo bash Password: sudo: pam_acct_mgmt: 7
0
8608
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9161
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9029
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8897
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6522
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4370
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2332
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2006
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.