Comments on: Poor man’s 2FA: a simpler 2-factor authentication mechanism for SSH https://ben.akrin.com/poor-mans-2fa-a-simpler-2-factor-authentication-mechanism-for-ssh/ Mon, 15 Nov 2021 03:20:01 +0000 hourly 1 https://wordpress.org/?v=7.1 By: n-factor SSH authentication for CentOS 7 - Boot Panic https://ben.akrin.com/poor-mans-2fa-a-simpler-2-factor-authentication-mechanism-for-ssh/#comment-403 Mon, 15 Nov 2021 03:20:01 +0000 http://ben.akrin.com/?p=1290#comment-403 […] However, if you are only concerned about implementing 2FA for sshd in tty sessions, you could look at using the ForceCommand option in your sshd configuration: http://ben.akrin.com/?p=1290 […]

]]>
By: Unix/Linux:n-factor SSH authentication for CentOS 7 – Unix Questions https://ben.akrin.com/poor-mans-2fa-a-simpler-2-factor-authentication-mechanism-for-ssh/#comment-402 Tue, 03 Nov 2015 17:48:02 +0000 http://ben.akrin.com/?p=1290#comment-402 […] However, if you are only concerned about implementing 2FA for sshd in tty sessions, you could look at using the ForceCommand option in your sshd configuration: http://ben.akrin.com/?p=1290 […]

]]>
By: Ben https://ben.akrin.com/poor-mans-2fa-a-simpler-2-factor-authentication-mechanism-for-ssh/#comment-401 Mon, 28 Jan 2013 03:19:38 +0000 http://ben.akrin.com/?p=1290#comment-401 In reply to enno.

I may have committed a change without testing it first πŸ™‚ Thanks for catching this.

Your solution is far superior I’m updating the code with it, and I swear I’ll test it tomorrow πŸ™‚

Thanks for sharing the 1337ness, please let me know when you have a YubiKey version working I’m interested!

]]>
By: enno https://ben.akrin.com/poor-mans-2fa-a-simpler-2-factor-authentication-mechanism-for-ssh/#comment-400 Mon, 28 Jan 2013 02:15:02 +0000 http://ben.akrin.com/?p=1290#comment-400 Love the idea of this and am adapting it to the Yubico keys. But I noticed in the awk line (to determine and run the users shell) you have nested backticks… once to run id -u to give you the users user ID and then around the whole ‘awk’ line. Not sure about your shell but this fails on mine.

I went with a simpler solution:

`awk -v name=$LOGNAME -F: ‘($1 == name) { print $7 }’ /etc/passwd`

You could of course refactor this to not require the assignment of name, but this was the least amount of change to your code.

Cheers.

]]>