Name of our file in our setup is gate.sh. The script looks like this“
[root@jarvis ~]# cat /usr/local/bin/gate.sh
#!/usr/bin/expect
set echo on
set timeout 5
spawn ssh -o “StrictHostKeyChecking=no” neo@gate.com
expect “neofit”
send “password\r”
expect *
interact
Obviously alias to be created in .bashrc:
alias gate='/usr/local/bin/gate.sh'