May
10
10
Shell Script – Automatically SSH Without Key
If you ever need to write a script that automatically SSHs to another computer, use this script. You’ll find that you cannot automatically SSH for two reasons.
- You can’t pass the password through the ssh command
- You can’t bypass the initial ssh key registration
This script can handle both these problems.
It requires the expect package, which is installed by default on OS X and most Linux distros.
#!/usr/bin/expect
spawn ssh username@hostname – o StrictHostKeyChecking=no
expect “Password:”
send “password\r”
interact
- Still working!!!!! 1 day ago
- Sweet 90% of the machines I manage are compromised. 3 days ago
- Gmail's "Priority Inbox" sorts important e-mail for you - http://bit.ly/cQaAgz 4 days ago
- People really struggle with basic things - lining up for a Southwest flight & printing boarding passes 6 days ago
- More updates...
Popular Posts
- 8 Best Sites to Watch Movies for Free
- How To Fix AddThis Toolbox for WordPress Blogs
- Apple App Store Now Showing Objectionable Material Warning Message - What A Joke
- Form Input - Readonly Vs. Disabled
- Drew Carey Gets Hit In The Nuts & Looks Old
- Best Free Jailbroken iPhone Apps
- Torry Holt's Nasty Finger








