Skip to content

Instantly share code, notes, and snippets.

@leonGravel
Last active March 8, 2020 13:46
Show Gist options
  • Save leonGravel/2225bfbed9fca9c3f4123aa230b8afd4 to your computer and use it in GitHub Desktop.
Save leonGravel/2225bfbed9fca9c3f4123aa230b8afd4 to your computer and use it in GitHub Desktop.
Connect to the server remotely
#!/usr/bin/expect -f
set user root
set host xxx.36.xxx.142
set password xxxxxxxx
set timeout -1
spawn ssh $user@$host
expect "*assword:*"
send "$password\r"
interact
expect eof
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment