iTerm & Automated Logins

To make your life a bit easier, (on Mac) download and configure iTerm and the following applescript files

iTerm

Download iTerm (note: This seems to have broken with iTerm 9.5.0611. For the time being install previous versions)

Scripts

Create a folder named Scripts (case matters) under [username]/Library/Application Support/iTerm/. Then open up Script Editor (Applications/AppleScripts/Script Editor). enter the script below and replace:

  • “give it a name” with something like Prod for a production server
  • “xx.xx.xxx.xxx” should be the IP to your server
  • “your password”… if you don't know to enter your password here and not literally “your password”, umm… well… good luck!
tell application "iTerm"
	activate
	set myterm to current terminal
	tell myterm
		set mysession to (make new session)
		tell mysession
			set name to "give it a name"
			exec command "/bin/bash"
			write text "ssh xx.xx.xxx.xxx -l root"
			delay 4
			write text "your password"
		end tell
	end tell
end tell


Now compile and save (ex. prod.scpt) to the Scripts Directory.

Once this is done, the next time you start iTerm, these scripts will be available from the Script menu.

To make things even easier you can assign these scripts to keyboard shortcuts using iTerm's built-in “Bookmarks” capability. Go to Bookmarks→Manage Bookmarks and assign these scripts within the dialog. (click the + button in the bottom left to add new bookmarks)

  1. The command for prod, for instance, is “osascript prod.scpt”.
  2. Working Dir is where should be set to ~/Library/Application Support/iTerm/Scripts. Do this for every script and assign a Shortcut key.
 
development/application_configurations/iterm.txt · Last modified: 2007/09/13 19:37 by vincenzobar
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki