Skip to content

Instantly share code, notes, and snippets.

@xi4oh4o
Created November 19, 2012 08:11
Show Gist options
  • Save xi4oh4o/4109531 to your computer and use it in GitHub Desktop.
Save xi4oh4o/4109531 to your computer and use it in GitHub Desktop.
ssh auto login script
#!/usr/bin/expect -f
set port you_port
set user you_user
set host you_ip
set password you_pass
set timeout -1
spawn ssh -nNTf -D $port $user@$host
expect "*assword:*"
send "$password\r"
expect eof
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment