• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Changing the info in the sudoers file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Changing the info in the sudoers file
      • From: Jeremy Reichman <email@hidden>
    • Re: Changing the info in the sudoers file
      • From: Philip Aker <email@hidden>
  • Prev by Date: Re: Replace : with / in Applescript
  • Next by Date: q.qqq vil tale med dig!
  • Previous by thread: Re: Replace Colon with Forward Slash
  • Next by thread: Re: Changing the info in the sudoers file
  • Index(es):
    • Date
    • Thread