Changing the info in the sudoers file
Changing the info in the sudoers file
- Subject: Changing the info in the sudoers file
- From: Tod Hallberg <email@hidden>
- Date: Tue, 15 Jul 2008 15:08:21 -0500
- Thread-topic: Changing the info in the sudoers file
I am needing to add some users to the sudoers file. I can do it manually,
but a script would be so much more efficient. I am going to run the script
from an account that is already in the sudoers file, and has admin rights.
This script is trying to copy the sudoers file to the desktop so I could
modify it.
***********************
set myHD to path to startup disk as string
set theETC to "private:etc:" as string
set pathToETC to myHD & theETC as alias
set POSIXpathToETC to POSIX path of pathToETC
--return POSIXpathToETC
set pathToSudoers to theETC & "sudoers"
set POSIXpathToSudoers to POSIX path of pathToSudoers
set pathToDesktop to path to desktop
set POSIXpathToDesktop to POSIX path of pathToDesktop
set sudoCommand to "sudo "
set sudoName to "monical_admin"
set sudoPassword to "m0n1ca1s"
set teminalCopyCommand to "cp -R "
tell application "Finder"
open folder pathToETC
end tell
do shell script sudoCommand & teminalCopyCommand & POSIXpathToSudoers & " "
& POSIXpathToDesktop user name sudoName password sudoPassword with
administrator privileges
***********************
This works to copy the file, them I can manually change it and copy it back,
but I would like to do it all in the script.
Thanx
tod
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden