xucito / cloud-os-tunnel Goto Github PK
View Code? Open in Web Editor NEWTunnel used for running scp and ssh commands through hypervisor.
License: MIT License
Tunnel used for running scp and ssh commands through hypervisor.
License: MIT License
Using become_user to a different user does not work.
This is probably due to the interactive elevation of the ssh session.
i.e.
ansible-playbook logstash.yml -i 0.0.0.0:5002, -e host_key_checking=false -e ansible_user=<different_user> -e ansible_password='<password>' -vvv --become-user root
Hi Tony,
Could you please add a feature that the tunnel should wait and reconnect after the VM got rebooted successfully.
I am getting following logs while rebooting the system using ansible
reboot: rebooting server...
ESTABLISH SSH CONNECTION FOR USER:
SH: EXEC sshpass -d44 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o 'User=""' -o ConnectTimeout=10 -o ControlPath= -tt '/bin/sh -c '"'"'sudo -H -S -n -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-walncydbeuynabfzovqtwoimsasjwsrn ; /sbin/shutdown -r 0 "Reboot initiated by Ansible"'"'"'"'"'"'"'"'"' && sleep 0'"'"''
Escalation succeeded
(0, "Shutdown scheduled for Thu 2 use 'shutdown -c' to cancel.\r\n", 'Shared connection to closed.\r\n')
reboot: validating reboot
reboot: attempting to get system boot time
ESTABLISH SSH CONNECTION FOR USER:
SSH: EXEC sshpass -d44 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o 'User=""' -o ConnectTimeout=10 -o ControlPath= -tt
'/bin/sh -c '"'"'sudo -H -S -n -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-ejawrehkglcufvelejgybblqkuzchcpz ; cat /proc/sys/kernel/random/boot_id'"'"'"'"'"'"'"'"' && sleep 0'"'"''
(255, '', 'mux_client_request_session: read from master failed: Broken pipe\r\nssh: connect to host port 22: Connection refused\r\n')
reboot: attempting to get system boot time
ESTABLISH SSH CONNECTION FOR USER:
SSH: EXEC sshpass -d46 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o 'User=""' -o ConnectTimeout=10 -o ControlPath= -tt '/bin/sh -c '"'"'sudo -H -S -n -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-qwevtqnsjqdyjszpzgaqitigzmhtaoql ; cat /proc/sys/kernel/random/boot_id'"'"'"'"'"'"'"'"' && sleep 0'"'"''
(255, '', 'ssh: connect to host port 22: Operation timed out\r\n')
reboot: attempting to get system boot time
ESTABLISH SSH CONNECTION FOR USER:
SSH: EXEC sshpass -d48 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o 'User=""' -o ConnectTimeout=10 -o ControlPath=/-tt '/bin/sh -c '"'"'sudo -H -S -n -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-esbcnwgvxhxhkwuzsjvqxecfluwkvfyr ; cat /proc/sys/kernel/random/boot_id'"'"'"'"'"'"'"'"' && sleep 0'"'"''
Escalation succeeded
(0, '4e7b13f2-673b-4df8-92c7-602b29a7fb22\r\n', 'Shared connection to closed.\r\n')
reboot: attempting post-reboot test command
ESTABLISH SSH CONNECTION FOR USER:
SSH: EXEC sshpass -d48 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o 'User=""' -o ConnectTimeout=10 -o ControlPath=/Users/afrozhussain/.ansible/cp/d941f5c128 -tt '/bin/sh -c '"'"'sudo -H -S -n -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-kyxaozmsqfbhygqgjacimouczqgrxies ; uptime'"'"'"'"'"'"'"'"' && sleep 0'"'"''
Escalation succeeded
(0, ' 10:46:03 up 0 min, 1 user, load average: 0.00, 0.00, 0.00\r\n', 'Shared connection to closed.\r\n')
reboot: system successfully rebooted
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.