Bash Scripts

[atigolo@centos7quadcore ~]$ more sshFreeShellLinux.bsh
#!/usr/bin/expect

#Source
# https://stackoverflow.com/questions/4780893/use-expect-in-bash-script-to-provide-password-to-ssh-command

#Put it to /usr/bin/exp, then you can use:

#exp <password> ssh <anything>
#exp <password> scp <anysrc> <anydst>

set timeout 20

#set cmd [lrange $argv 1 end]
set cmd "ssh RobotLivesMatter@tty.freeshell.org"

#set password [lindex $argv 0]
set password "thepassword"

eval spawn $cmd
expect "assword:"
send "$password\r";
interact