[kwlug-disc] How to ... having ssh key connected ... ask for password, logout if fail?

B. S. bs27975 at gmail.com
Thu Oct 6 11:20:05 EDT 2016


On 10/06/2016 11:11 AM, Chris Irwin wrote:
> On Thu, Oct 06, 2016 at 09:00:18AM -0400, B. S. wrote:
>> On 10/05/2016 05:06 PM, Bob Jonkman wrote:
>>>
>>> Perhaps you can ssh-with-certs into an unprivileged account, then from
>>> there 'su username' into the real account to get things done. That'll
>>> ask for a password...
>>
>> This appears to be the answer. Near the top of ~/.bashrc, not
>> ~/.ssh/rc, add:
>
> Note: This will not work unless .bashrc is sourced. The user could
> simply run some other alternative command.

Which it is.

My testing indicates a correct solution in all cases I could think of.

Attempting to run any other command results in immediate logout / 
disconnection.





More information about the kwlug-disc mailing list