sudo pip install onetimepass
- 需要okta绑定 google authenticator 时 QR code里面的16位的 secret, android 用 barcode scaner 一扫就知道了
- 填到 auth.py 里
- 填用户名密码到 inputs.txt
- 以后每次运行 ./vpn connect (用 zsh or fish) 就登上了
vpn diconnect
下线
-
-
Save jcouyang/68f487656bacb6535c7e to your computer and use it in GitHub Desktop.
thoughtworks VPN 1 click login script
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
import os | |
import onetimepass as otp | |
my_secret = 'SECRET_FROM_QRCODE' | |
print otp.get_totp(my_secret) |
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
y | |
USENAME | |
PASSWORD | |
3 | |
AUTHENTICATOR_CODE | |
exit |
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
#!/bin/zsh | |
answers=$(sed 's/AUTHENTICATOR_CODE/'$(python auth.py)'/g' inputs.txt) | |
echo $answers | /opt/cisco/anyconnect/bin/vpn -s $1 bjvpn.thoughtworks.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
inputs.txt 里面第一行的 y 好像已经没有用了。