Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

脚本ssh登录 #16

Open
cheungseol opened this issue Nov 7, 2017 · 0 comments
Open

脚本ssh登录 #16

cheungseol opened this issue Nov 7, 2017 · 0 comments

Comments

@cheungseol
Copy link
Owner

cheungseol commented Nov 7, 2017

脚本ssh登录开发机

test.sh

chmod a+x test.sh

#!/usr/bin/expect -f
  
set USER cheungseol // username
set HOST 1.1.1.1  // fake host addr
set PASSWORD test123 // password
set timeout -1  // expect mode never time out
  
spawn ssh $USER@$HOST
expect "*assword:*"  
  
send "$PASSWORD\r"  
# expect eof 
interact 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant