Re:Simple Two-Factor SSH Authentication
by pedrocr on Friday September 23, 2011 @11:09AM
(#3030222)
In the authorized_keys script, if instead of exec()ing SHELL you use SSH_ORIGINAL_COMMAND you won't break "ssh myhost <command>"
[ Parent
| on HN ]
Re:Simple Two-Factor SSH Authentication
by moomerman on Friday September 23, 2011 @11:11AM
(#3030234)
In the extended example it does actually use the SSH_ORIGINAL_COMMAND, will update the simple version too
In the extended example you're falling back to exec(SHELL) if SSH_ORIGINAL_COMMAND doesn't exist. Does sshd not set that to the login shell if no command is specified by the client?
Re:Simple Two-Factor SSH Authentication
by moomerman on Friday September 23, 2011 @11:17AM
(#3030262)
SSH_ORIGINAL_COMMAND isn't in the ENV at all if no command was passed through
Right, that was what I asked in my other post. I assumed sshd would fill in the login shell there if nothing was passed as that is effectively what is being called but it seems not. I see you're doing exec(SHELL) to fix that.