As mentioned in the title, aiming to automate ssh using the expect command Write an article.
Automate ssh connection to vagrant currently on your device And even some confirmation commands are automated.
I referred to the following article for the goal. https://qiita.com/ine1127/items/cd6bc91174635016db9b#comments
Since my motto is to think while moving my hands, I will write a command for the time being.
#!/bin/sh
expect -c "
set timeout 5
spawn vagrant /usr/bin/ssh
expect \"$\"
exit
"
The result didn't go well ...
spawn vagrant /usr/bin/ssh
I think the above expression is strange,
I don't know what to do specifically. .. ..
I'm not sure, but instead of entering with vagrant ssh There are many cases of ssh connection with IP address, and I expect that it will work. ..
cat Vagrantfile
config.vm.network "private_network", ip: "192.168.33.10"
Check the IP address and start SSH connection! !!
ssh 192.168.33.10
192.168.33.10: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
Remorse ... If you google lightly, it seems that the authority relationship is the cause, but ... Due to lack of knowledge, it ends today. ..
Recommended Posts