Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Password Applescript

Password Applescript
Thread Tools
Forum Regular
Join Date: Jun 2003
Location: California
Status: Offline
Reply With Quote
Jul 1, 2003, 06:20 PM
 
Is there a way to make an apple script that will enter in your password and hit return inside telnet running within the terminal?
     
Fresh-Faced Recruit
Join Date: Jan 2003
Location: West London, England
Status: Offline
Reply With Quote
Jul 1, 2003, 06:46 PM
 
Do you intend to run the script manually when you want to enter the password? What applications are you running that require passwords - there may be a more elegant way of accomplishing the same task. For example is you are an SSH user you could save yourself a lot of hassle by running SSHPassKey and "SSH Agent", then you'd never need to enter your SSH passphrase again...

Anyway, you asked about AppleScript. The following works for me in limited testing:

tell application "Terminal"
do script ("your_password" & return) in front window
end tell

I tested this on a login command I entered manually in the shell (i.e. > login my_username), which prompts for a password. Running this script with the correct password logged me in.

If you want to do things properly you should have AppleScript pull the password out of your Keychain, since storing the password in the script is very insecure.
     
Forum Regular
Join Date: Jun 2003
Location: California
Status: Offline
Reply With Quote
Jul 1, 2003, 08:28 PM
 
Thank you

The complete story is that I need to connect to a server through telnet, and i noticed it just used your user name as your login, so i made a new user with the right name, but i want to make a script that will type in my password. So far i have written the part that opens the terminal, changes the colors, then connects to the server.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 08:11 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2