Created
December 7, 2017 05:34
-
-
Save ketankr9/2f66ec77533851f6e4afcde80bae5536 to your computer and use it in GitHub Desktop.
automated ssh login using expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############### provide password of the login using script | |
#!/usr/bin/expect -f | |
spawn ssh username@host_ip | |
expect "username@remote_ip's password: " | |
send "password\r" | |
interact | |
################################################### | |
## B is my computer, A is the remote computer, transfer files from A to B. | |
scp username@A_ip:~/song.mp3 song.mp3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment