How to disable sudo command in Terminal
How to disable sudo command in Terminal
Bad idea.
Only an Admin user can use sudo, so if you have users on your system that you do not want to use sudo, then do not give them an admin account, and do not give them the password for an admin account.
Similar Messages
-
How to disable TextEdit's automatic termination after closing last open document?
Hi!
I was wondering how to disable TextEdit's automatic termination after closing the last open document.
It's so annoying!
Thanks for everything!
Chris.Quit TextEdit, launch the Terminal app in /Utilities, copy & paste this one-liner into the window that pops up, hit the return key, quit the Terminal app, and restart.
defaults write com.apple.TextEdit NSDisableAutomaticTermination -bool yes
27" i7 iMac (Mid 2011) refurb, OS X Mavericks (10.9.5), ML & SL, G4 450 MP w/Leopard, 9.2.2 -
How to disable put command?.
Hi,
I need to know how to disable "put" command on iPlanet Web Server?.
Would appreciate any comments/response. Please reply to [email protected]
Thanks,
RengaSet document security on the PDF.
Aandi Inston -
Applescript for running sudo commands in terminal
I'm a newbie when it comes to Applescript and was wondering if someone could help with a basic request. I need to write a small script to do the following:
1. Launch terminal
2. Run the 'Sudo -s' command
3. Enter the administrator password (in plain text)
and then
4. run some sudo commands like "sudo defaults write /Library/Preferences/com.apple.loginwindow HiddenUsersList -array-add administrator"
I actually WANT the administrator password to be in the script in plain text even though I understand the security risks (I will literally be the only person to ever see the script). I've trawled forums all over but can't seem to find what I am looking for and cannot get it working by patching together the various commands I have found. Thanks in advance for any help you can give!
SeanI've included two examples. The preferred way & the hacker way.
with administrator
It is easier to diagnose problems with debug information. I suggest adding log statements to your script to see what is going on. Here is an example.
Author: rccharles
For testing, run in the Script Editor.
1) Click on the Event Log tab to see the output from the log statement
2) Click on Run
For running shell commands see:
http://developer.apple.com/mac/library/technotes/tn2002/tn2065.html
on run
-- Write a message into the event log.
log " --- Starting on " & ((current date) as string) & " --- "
-- debug lines
set unixDesktopPath to POSIX path of "/System/Library/User Template/"
log "unixDesktopPath = " & unixDesktopPath
set quotedUnixDesktopPath to quoted form of unixDesktopPath
log "quoted form is " & quotedUnixDesktopPath
try
set fromUnix to do shell script "sudo ls -l " & quotedUnixDesktopPath with administrator privileges
display dialog "ls -l of " & quotedUnixDesktopPath & return & fromUnix
on error errMsg
log "ls -l error..." & errMsg
end try
end run
This version has an inline password.
Notice the echo 'password' |
The single quotes are no accident.
It is easier to diagnose problems with debug information. I suggest adding log statements to your script to see what is going on. Here is an example.
Author: rccharles
For testing, run in the Script Editor.
1) Click on the Event Log tab to see the output from the log statement
2) Click on Run
For running shell commands see:
http://developer.apple.com/mac/library/technotes/tn2002/tn2065.html
on run
-- Write a message into the event log.
log " --- Starting on " & ((current date) as string) & " --- "
-- debug lines
set unixDesktopPath to POSIX path of "/System/Library/User Template/"
log "unixDesktopPath = " & unixDesktopPath
set quotedUnixDesktopPath to quoted form of unixDesktopPath
log "quoted form is " & quotedUnixDesktopPath
try
set fromUnix to do shell script "echo 'password' | sudo ls -l " & quotedUnixDesktopPath
display dialog "ls -l of " & quotedUnixDesktopPath & return & fromUnix
on error errMsg
log "ls -l error..." & errMsg
end try
end run -
How to disable voice commands on a N82?
I have recently bought a Nokia N82. Since I started using the mp3 player, I have been dialing random people, and I realized it happens when I am wearing the provided headset (HS-43). The largest button on the headset remote activates voice commands.
The problem is that the headset remote is hanging where my arms are when I'm resting them on my stomach. This has caused quite a lot of random calls while I'm in a conversation (not wearing the earplugs ;-). Luckily I haven't said anything that could get me fired from my job, yet :-)
My question is; how do I *completely* disable voice commands?
(I would have assumed something trivial like "go to voice commands, settings, disable" - but I can't seem to find that option?!! :-(me too have the same problem...
its difficult to remember to remove the headset every time you remove it from the ear...
R u sure this feature cannot be disabled?
Regards, -
How to delete a command in Terminal?
Months ago I tried to sync ical via Dropbox, which required entering a command in Terminal. Now I'd like to reverse the action. How do I go about deleting or countermanding this command? Thanks.
Based on the symlink you created long ago, your calendar directory is currently stored in Dropbox. If you want to keep your calendar data you will need to move it back to ~/Library/Calendars.
To be on the safe side use the ls command to see which is the symlink and which is the real directory:
ls -ld ~/Library/Calendars ~/Dropbox/Calendars
The one that starts with L and contains 2 file paths as in
lrwxr-xr-x 1 username group 9 Dec 4 2011 /Users/username/Library/Calendars -> /Users/username/Dropbox/Calendars
is the symbolic link
The one that starts with D is the real calendars directory, for example:
drwxr-xr-x 1 username group 9 Dec 4 2011 /Users/username/Dropbox/Calendars
NOTE: I strongly suggest you have a current backup before you use the 'rm' command below. One mistake with 'rm' (remove, aka delete) and you can loose data that you are not going to get back.
To remove the symlink, and put your calendar data back where iCal expects to find it, use the following commands:
rm ~/Library/Calendars
mv ~/Dropbox/Calendars ~/Library/
The rm command is removing the symlink you created.
The mv command is moving your calendars information to ~/Library where iCal expects to find it. -
I have a 45mb/s internet at home and my youtube videos load extremely slow, after reading many blogs and empting my cache cleaning my history I stumble across a post that told me i had to block two IP's on the terminal using this two commands: " sudo ipfw add reject src-ip 173.194.55.0/24 in" and "sudo ipfw add reject src-ip 206.111.0.0/16 in" that it should help. After I did that and restarted the mac those commads are undone. Is there a way to save thos commands tipped in the terminal??
Open the AppleScript Editor in the /Applications/Utilities/ folder and paste in the following:
set thepass to text returned of (display dialog "Your administrator password is needed." default answer "" buttons {"Cancel", "OK"} default button "OK")
do shell script "ipfw add reject src-ip 173.194.55.0/24 in" password thepass with administrator privileges
do shell script "ipfw add reject src-ip 206.111.0.0/16 in" password thepass with administrator privileges
Save it as an application and add it to the list of login items for your user account in the Users & Groups pane of System Preferences.
(81466) -
How to disable Shift/Command/Option lock?
Ever since I updated to 10.8, if I press shift, command, or option twice it will put it into like a lock mode. How can I disable this & have it back to the way it used to be?
Thanks for the suggestion but that didn't help. I don't have a keyboard & mouse pane I only have keyboard or mouse to choose from, so I go to keyboard and there is nothing that looks like that screen. But I did find something that fixed my Command/Option/Control buttons from being locked, I clicked on Keyboard & then Modifier Keys, and it let me select no action for each of those, BUT it doesn't have the Shift option.
So now my problem is, when I press Shift twice in a row, it makes it lock. It's as if I'm holding down Shift all the time and I have to press Shift again to unlock it. I want to disable this. Does anyone have any ideas how to do that? I think I explained it wrong in my 1st post I thought I'd explain again (: But now I figured out it's called Modifier Keys soo I feel like I'm close to finding the answer. lol (: -
How to disable Shift-Command-C command?
How do i disable the Shift-Command-C command?
(It clashes with the cheat console in spore and they are both activated by Shift-Command-C)
Any help welcome.Hi,
Most likely it will be in System Preferences > Keyboard > Keyboard Shortcuts
10:26 PM Sunday; December 30, 2012
Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
iMac 2.5Ghz 5i 2011 (Mountain Lion 10.8.2)
G4/1GhzDual MDD (Leopard 10.5.8)
MacBookPro 2Gb (Snow Leopard 10.6.8)
Mac OS X (10.6.8),
Couple of iPhones and an iPad
"Limit the Logs to the Bits above Binary Images." No, Seriously -
Sudo Command with installation
Hi,
I am trying to install a software called Fullprof suite. Upon downloading, I have to follow the directions listed here:
http://www.ill.eu/sites/fullprof/php/downloads.html
I'm supposed to use the sudo command in terminal, which may lead to data loss. I'm pretty new to this sort of thing, so I would like to confirm that the text I am entering is safe, and only allows installation of the program:
sudo ln -s /Applications/Darwin/openmotif-2.2.3-universal /usr/OpenMotif
I am running on MacBook (2008), 10.5.8.
Any help would be appreciated. I tried running this program on our pc and now that computer doesn't start....1. Revokes the permissions the first command granted so that nothing else can take advantage of them.
2. Because it's making changes to system-level folders. This is the same reason why most of Apple's software updates require an administrator password.
(77525) -
I want to disable 'Spotlight' for repairing my disk "Macintosh HD" , but somehow the command 'sudo mdutil -a -i off' does not work in 'Terminal'. I get result as ' bash: sudo: command not found' .I am using OS 10.10. Please help.
It appears that you may not have a properly installed OS X system.
You must be connected to the Internet to reinstall OS X.
In the menu bar, choose Apple menu > Restart. Once your Mac restarts (and the gray screen appears), hold down the Command (⌘) and R keys.
Select “Disk Utility,” and then click Continue.
Select your startup disk from the list on the left, and then Repair Disk.
After disk is repaired, select Reinstall OS X, then click Continue.
Follow the onscreen instructions. In the pane where you select a disk, select your current OS X disk -
Terminal doesn't understand sudo command
I am installing MacPorts 1.7.0 from a .dmg file. Following, I set up the environment variables in the .profile file, and tried to use Terminal to update using the sudo port selfupdate command from Terminal.
This is the result I got:
-bash: sudo: command not found
Why is this, and what can I do?I think the error refers to the command(s) following "sudo." Were you prompted for your password?
No, that would be:
sudo fred
Password:
sudo: fred: command not found
But if the command bash is asked to execute is not found you get
fred
-bash: fred: command not found
So I think he is not finding sudo.
That makes me think that PATH has been messed up, because sudo is in /usr/bin/sudo which is always in PATH unless it has been messed up. Which makes me think that .profile was properly executed, and that is how PATH got messed up.
So I would look very closely at .profile and make sure PATH is setup correctly. I would expect it to looks something like:
export PATH="$PATH:/opt/local/bin" -
How to create script that run sudo-command?
I often need to run command:
sudo "/Library/Application Support/VMware Fusion/boot.sh" --restart
This needs to be run as admin.
Can anybody tell me how to create script that will login as admin and run that command in terminal?
Or from where can I get help how to add commands to a script?
Thanks
TomiYour best bet on getting a cogent answer is to post to the Unix forum under OS X Technologies.
-
Sudo command not working in terminal
When I was trying to perform a action in terminal it was saying "permission denied". When I tried it with the sudo command it was showing the following error.
Can anyone please help me out in resolving this error.
Thanks & Regards,
Teja.Hi,
Thanks for the response. I have tried the procedure suggested by you. But I was struck up with this issue. "repair disk permissions" option is disabled. So can you help me out in finding a solution.
Thanks & Regards,
Teja -
Isight not working anymore after a sudo command i put on terminal
i have not been able to get the smc to work.. but i am almost positive what the problem is that sudo command killall for coremedia command i did..b ecause not my isight built in camera will not work for any application.// this has me freaking out.. please if anyone could guide me through whatever it takes to get this isight camera working that would be a life saver.. i do not believe that it is hard ware because it was working just fine that entire day until i did something in terminal trying to stop the coremedia processes not knowing what they were..
Post the exact command you entered in terminal.
You can copy and paste the single command from the output of:
history
Maybe you are looking for
-
Problem with driver initialization and associated application
I am recertifying a application suite on Solaris 10. This product works well on Solaris 8 & 9. It contains a special psuedo/streams device driver that allows applications to open a port to a daemon that manages clean up of these applications. The dae
-
Help We lost power and everything on the computer. I have recovered itunes and the 483 purchased songs But I have 1895 songs on my iphone. How can I get my iphone library back on my computer library?
-
Payroll infotypes disappearing after a client copy
Hi everyone, Our project team has done a client copy to two new clients (configuration and master data), and then decommissioned the source client. However, for some reason a number of infotypes do not appear against employee records in PA30. The inf
-
Now You Have iPhone 4, What are You Doing w/ Your Old iPhone?
It basically becomes and iPod Touch if you disable the network and enable the wireless. Have any charities mentioned that they will take old iPhones?
-
I am using Firefox 16.0.1 on a macbook pro using 10.7.5 software. When I access a picture directly, I am unable to advance the photo forwards or backwards using the mouse/cursor or the arrow keys. The same is true if I use an external mouse. If I use