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

portproxy totp feature question #4

Closed
illusionzhy opened this issue Apr 28, 2020 · 2 comments
Closed

portproxy totp feature question #4

illusionzhy opened this issue Apr 28, 2020 · 2 comments

Comments

@illusionzhy
Copy link

illusionzhy commented Apr 28, 2020

hello ,I want use the totp feature (user connect portproxy with username(mysql -u option) and password(username + (6 bit number from totp) by default);

example:

first:
./portproxy -backend="127.0.0.1:3306" -bind="0.0.0.0:3316" -conf="conf.cnf" -buffer=16384
2020/04/28 15:59:58 portproxy started.
second:
sys-google-totp --secret OJ3UAWO4CIB7M3DQ
totp message:
secret: OJ3UAWO4CIB7M3DQ
671114 (20 second(s) remaining)

starting the program,but I don‘t ’understand the logic
test demo:

mysql -u127.0.0.1 -P3316 -utest -ptest671114
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'test'@'localhost' (using password: YES)

the conf.cnf- [onlineread] configure is correct,what should i do ?

@arstercz
Copy link
Owner

hi @illusionzhy , it seems that the above error is due to not using the correct version, you should use totp-version, and import totp-test.sql to your conf.cnf - [backend]. the following sql should be insert into table otp_secret:

insert into otp_secret values('test', 'OJ3UAWO4CIB7M3DQ');

portproxy - totp will get secret code from table otp_secret by your mysql user, and calculate the 6 digits of the secret code, compare it to the password you entered.

note: only used in test environments.

@illusionzhy
Copy link
Author

@arstercz thanks for your help. test completed successfully.

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

2 participants