Jump to content
  • Announcements

    • Allan

      Forum Rules   04/13/2018

      Hello folks! As some things are being fixed, we'll keep you updated. Per hour the Forum Rules don't have a dedicated "Tab", so here is the place that we have our Rules back. New Users Lounge > [READ] - InsanelyMac Forum Rules - The InsanelyMac Staff Team. 
Sign in to follow this  
seanboy50

Applescript for running sudo commands in terminal

1 post in this topic

Recommended Posts

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!

 

Sean

 

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.



×