I'm working on a project where I need to enhance server access security by using Time-based One-Time Passwords (TOTP). Currently, I'm using a Telegram bot to share an SSH key for user access, but I want to replace this with a TOTP solution. My goal is to have users authenticate their access through Google Authenticator or a similar app. Does Google provide an API for this? If not, what tools can I use to generate TOTP and connect it to my Bash script on the server? How can I ensure that the OTP gets sent through the Telegram bot to grant access?
3 Answers
I'm not sure how TOTP ties into your Bash script. Is your script running on the server or client side? It’s important to clarify this, as TOTP would typically apply to the server-side authentication process.
Typically, users should only share the public half of their key pair for access. I'm curious about why you're keen on implementing TOTP... It seems like a lot of extra work for something that might not be necessary.
There are plenty of resources out there detailing how to integrate Google Authenticator as an additional security factor for SSHD. Check out this guide: [https://goteleport.com/blog/ssh-2fa-tutorial/](https://goteleport.com/blog/ssh-2fa-tutorial/) for some step-by-step instructions.

Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically