Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- ip=172.16.0.1 #replace 172.16.0.1 with your unix server's ip
- username=anitha #your ssh username
- password=anitha #your ssh password
- command=who #what do you want to do with remote server
- arguments= #arguments for your command
- expect -c 'spawn ssh $username@$ip ; expect password ; send "$password\n" ; interact'
Add Comment
Please, Sign In to add comment