execute a command as another user

learn more… | top users | synonyms

3
votes
2answers
85 views

How can I specify shutdown time with “sudo shutdown”?

In the following Terminal command sudo shutdown -r now, there is a time set ("...now"). Is there a way to set a specific time. For example, could it be sudo shutdown -r -int 1200?
1
vote
3answers
175 views

sudo: /etc/sudoers is owned by uid 501, should be 0

To run programs as sudo without password, I edited /etc/sudoers with wrong content. Then I re-edited it with Mac's default text editor(course sudo cannot be used when /etc/sudoers is wrong). I ...
1
vote
0answers
16 views

Terminal 3 failed password attempts

I've got a really funny issue with my Mac at the moment. I was using a sudo command and it rejected my password 3 times (I double checked and the password was correct) but now I can't do anything as ...
1
vote
2answers
143 views

How to open a shell script in a new Terminal window and run it with administrator privileges

I need to programmatically open a shell script in a Terminal window and run it with administrator privileges. I'm using osascript as it displays a convenient prompt for an admin login/password. I'm ...
0
votes
1answer
29 views

How can I run a script or app as sudo with a click?

I have a certain program that doesn't work right unless I run it as sudo. I don't mind having to type in my password, but I'd like to get out of the whole process of opening command line and typing ...
1
vote
1answer
21 views

Access to sudo but not security and privacy or users and groups

How can I add myself to these groups so that I can have access to these areas in system preferences? I have sudo access but I'm not sure how to accomplish this through terminal.
0
votes
1answer
178 views

Opening apache conf file with write permissions

I'm trying to open the /private/etc/apache2/httpd.conf file to make some changes. I thought I'd be able to open this with the correct permissions from the command line, so I tried: cd ...
1
vote
0answers
34 views

What is a reasonable command to prompt for sudo password with sudo -A?

My question is definitely related to What option should I give the sudo command to have the password asked through a graphical interface? But my question is slightly different. I know how to use sudo ...
1
vote
1answer
37 views

Rsync fails due to Sudo timeout

I am trying to run a lengthy Rsync (local machine only, no ssh, no lan or wan connects involved) but Sudo is timing out and the script fails. Total runtime of the command is about 20 mins. What is the ...
0
votes
1answer
55 views

I added my username to /etc/sudoers but using sudo still asks for password

I entered my username in the sudoers file, but when using sudo in scritps, it still asks for the password. This is my sudoers file: ~: ls -al /etc/sudoers -r--r----- 1 root wheel 1297 Aug 14 ...
0
votes
1answer
47 views

How to edit /etc/profile using emacs?

I am using Emacs 24.3 on Mac OS X 10.9.4 and I am trying to edit /etc/profile with that. It obviously does not work when starting the GUI version, but for some reason, it also does not work when ...
0
votes
1answer
254 views

sudo: unable to cache user root, already exists

Suddenly started getting this strange error when attempting to run any command via sudo: sudo: unable to cache user root, already exists I've tried different Terminal windows, repairing ...
2
votes
3answers
313 views

Run GUI Applications from Terminal with root privilege

So it has been well documented that GUI applications (like gedit or textedit) should NOT be run with sudo. Ubuntu et al get gksu and gksudo (and the like) so question: what do WE (Mac users) get? ...
2
votes
1answer
173 views

Super and admin user in OS X

Superuser account is disabled by default in OS X (Mavericks). But if you run sudo -l you will come to know that the admin user can execute all superuser commands. Then what is the point of disabling ...
0
votes
1answer
434 views

Using visudo to edit sudoers on Mac

I have managed to make the sudoers file on my Mac erorr. eg. $ sudo visudo >>> /etc/sudoers: syntax error near line 45 <<< sudo: parse error in /etc/sudoers near line 45 sudo: no ...
0
votes
0answers
19 views

2 usercodes on one machine

I have to run two usercodes on my MacBook Pro (running OSX 10.9.2), because my university insists that certain operations on the university system (the only crucial operation is printing) can only be ...
0
votes
1answer
59 views

Recovering files deleted via sudo

I deleted some files via sudo rm -rf ~/.Trash/* - unfortunately I accidentally moved a folder from the Desktop into there and can't seem to recover it. I only use this command now and then, when I ...
0
votes
1answer
185 views

Is it OK to run -sudo purge, frequently? [duplicate]

I'm on Mavericks 10.9.2, 24GB's RAM, and my usage constantly teters on 23.95 GB in use very frequently. From what I can tell, the largest running process is 'kernel_task', and even then it's less ...
2
votes
1answer
1k views

Homebrew / link osxfuse not possible

I didn't run brew doctor since a lot of time. Know it tell me I should run brew link osxfuse. Here I show you the rest: Newton:~$ brew link --overwrite osxfuse Warning: Could not link osxfuse. ...
5
votes
6answers
8k views

How to fix curl: (60) SSL certificate: Invalid certificate chain when using sudo

So since the Mavericks upgrade curl has more issues with certificates. When trying to curl a file from my web server with it's self-signed certificate it was getting the error "SSL Certificate: ...
1
vote
2answers
612 views

Installing / removing encfs

I'm trying to install encfs, for which I need brew. I installed brew, but installing encfs is a pain. bash-3.2$ brew install osxfuse Warning: osxfuse-2.6.2 already installed, it's just not linked ...
1
vote
2answers
62 views

Unable to start computer after using sudo crontab -e

I've set it so that my Mac will forcefully shutdown at 12:00 everyday. But I try to turn it back on, it shuts down again right after.
0
votes
0answers
86 views

How to grant permission to application permanently

I have an application starts automatically when i'm logged in that changes some internet settings for me. I have to enter my password every time, that's quite annoying. Is there any way I can grant ...
5
votes
1answer
5k views

Sudo keeps asking for password, despite that NOPASSWD already set

The following sudoers configuration used to work well in MacOS 10.8.5, several days ago I upgraded to Mavericks, NOPASSWD flag does not seem to work anymore: # User privilege specification root ...
2
votes
2answers
7k views

Sudo password doesn't work even if I have no password

I've erased the password from preferencenow I can log in without using any password but when I run a sudocommand terminal ask me a password if I insert nothing or the old one it return error. What's ...
0
votes
1answer
1k views

How to block and unblock the media ports in MAC OSX 10.9? [duplicate]

I am working on a test project that requires me to block all media ports on my Mac OS X 10.9. The instructions I'be veen given are "Chinese" to me :-) I have no idea how and where to start, let ...
0
votes
1answer
229 views

Cannot create a file with sudo in Apache web directory

Suddenly the following problem has happened: I have an Apache web directory at /www. Everything was ok with the permissions, but at some point (I can't realize what caused it), I become unable to ...
0
votes
1answer
7k views

su & sudo on OSX Mavericks

I am trying to use su and sudo on my iMac that I did a fresh clean install of Mac OS X 10.9 and Server 3.0. I explicitly set the password for root with passwd root but when I try to use su or sudo ...
0
votes
3answers
3k views

Issue installing MacPorts on Mavericks

I try to install MacPorts and get this $ sudo make install make: getcwd: Permission denied shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied ...
0
votes
1answer
122 views

sudo requires root password

I've got an admin user phil with password orange, and the root user is enabled with password banana: If I type sudo ls, and enter the password orange, I get Sorry, try again. If I type sudo ls, and ...
1
vote
2answers
91 views

Change root password to be different than Admin password

I want to change the root password so it is different than the admin password. I need to change the password so the admin can still be logged on, but the root password to modify the hosts file ...
2
votes
3answers
4k views

How do I run sudo command from standard account?

From what I've read, it is good security approach to have two accounts, one admin and one standard. I am trying to run the following command in terminal on my standard account sudo mv ...
0
votes
1answer
230 views

Help me reset the terminal after sudo command mistake

I recently installed a cracked version of a program and it instructed me to block outgoing connections by following the instructions below. Step 1 Click the "Go" menu, select "Utilities," and then ...
3
votes
1answer
715 views

Changing read permissions on /private/etc recursively

I was trying to make my /private/etc folder and all its contents world-readable. 'Permission denied' messages from a number of internal files and folders were a recurrent theme whenever I did a find ...
1
vote
0answers
119 views

Sudo works for a whole day and then stops working until a reboot

I currently have admin access to a Macbook Pro running OSX 10.8.4. I have been sudoing at the terminal for the whole day with no restart until sudo stops working. I rebooted the operating system and ...
1
vote
2answers
213 views

Is there a way to set an Application Shortcut in the Keyboard Preference Pane via Terminal?

I'd like to have a bootstrap for my custom keyboard shortcuts to use on multiple machines...
0
votes
1answer
96 views

cannot run sudo

I have a corporate account work on my macbook that has administrator privileges and created a non-administrative account local. Logged in as local, when I tried a command with sudo, I got the ...
0
votes
2answers
152 views

Upgrading from sudo 1.7.4p6 to 1.8.6p7 on OS X 10.7.5

I downloaded sudo for os x 10.7 from the following link, I followed the readme instructions, but when I call sudo -V I still get the old version number. I can see the folders related claim to have ...
0
votes
0answers
377 views

Mac asking for password for some files when deleting [duplicate]

This happens not for all files. When I move or delete some of the files on my external drive Finder will ask for password. Is it due to permission set on these files ? Can I use something like Sudo ...
1
vote
2answers
526 views

Password problems changing users in Terminal

I'd like to switch between the default user in Terminal and the user 'postgres', created when I installed PostgreSQL 9.2. If I type su postgres, I'm prompted for a password that I don't know and ...
2
votes
1answer
289 views

How can root launch a regular Mac application from a cron job in /etc/crontab?

I want the cronjob to do some things as the superuser, and depending on the result, launch an app as me, the logged-in user. I've tried a bunch of things but nothing I think should work does. ...
1
vote
0answers
55 views

allow sudo only at a specific time of day

Is it possible to configure sudo so that it only works at a specific time of day, say, from 9AM to 10AM? In Linux, this can be done by editing /etc/security/time.conf, but I don't know if this is ...
1
vote
0answers
1k views

My MBP (13 inch, MID 2010) will not start up

I have used the internet for the past 2 weeks in search of something that will help me troubleshoot/repair my MBP. It wont boot in Safe Mode using the SHIFT key. Following is everything I have tried ...
1
vote
2answers
5k views

Terminal returns not found for most commands Mac OSX

I'm really new to Mac OSX and UNIX based systems. I wanted to run a few Windows games on my Mac Mini so I started installing Wine and MacPorts. Having done so, I typed in sudo port install wine and ...
10
votes
2answers
29k views

allow sudo to another user without password

I want to be able to 'su' to a specific user, allowing me to run any command without a password being entered. For example: If my login were user1 and the user I want to 'su' to is user2: I would ...
5
votes
3answers
809 views

After typing sudo I can no longer autocomplete commands by pressing Tab

In a Terminal, if I type beginning of any command by pressing tab I can see the rest of that command. However this feature does not work with any words I type after sudo. How can I complete command ...
1
vote
3answers
964 views

How do I schedule a root command to run at intervals?

I need to run a script in intervals that requires a root user to execute. I created a plist that will call a script in ~/bin/test.sh. user@MBP:~$ ls -lah ~/bin/ -rw-r--r-- 1 root staff 566B ...
3
votes
2answers
10k views

How do I give a user sudo permissions?

On my computer I have two accounts: geoff and admin. I want to do gacutil.... Doing it in account geoff (where I need it to be done) I get the message: gac directories could not be created, possibly ...
4
votes
1answer
2k views

whoami is not who I am!

I login into my own computer as username geoff. When I open a terminal I have as prompt: Geoffs-MacBook-Air:~ org1$ The org1 is my work username! I have no login of that username for this computer ...
0
votes
1answer
77 views

Why is sudo running so many times?

I've just noticed that my mac has loads of sudo processes running – why? What is causing them?