1 |
On 18/10/2013 16:05, Tanstaafl wrote: |
2 |
> On 2013-10-18 7:19 AM, Alan McKinnon <alan.mckinnon@×××××.com> wrote: |
3 |
>> On 18/10/2013 12:23, Tanstaafl wrote: |
4 |
>>> On 2013-10-17 10:30 PM, Walter Dnes <waltdnes@××××××××.org> wrote: |
5 |
>>>> I apologize. That is arguably a two factor system. When you said |
6 |
>>>> "ssh key and password", I "jumped to delusions", assuming that it was a |
7 |
>>>> standard ssh connection with the option of either key or password. |
8 |
>>> |
9 |
>>> Side question... |
10 |
>>> |
11 |
>>> So, wouldn't the simplest two-factor authentication be an SSH key that |
12 |
>>> required a password? |
13 |
> |
14 |
>> No, there is no way to verify that a user has enabled a passphrase on an |
15 |
>> ssh key. |
16 |
> |
17 |
> No... I mean... |
18 |
> |
19 |
> If I create an SSH key that requires a password (ie, not a 'blank' |
20 |
> password), then when I use this ssh key to connect to the system it was |
21 |
> created for, and it asks for the password... |
22 |
> |
23 |
> This is, as far as I can see, a poor man's 'two-factor' authentication, |
24 |
> is it not? |
25 |
> |
26 |
|
27 |
|
28 |
I think you are misunderstanding how ssh keys work. |
29 |
|
30 |
You do not create "an SSH key that requires a password", instead the |
31 |
user sets up private key encryption locally with a secret. To use the |
32 |
key it must be unlocked (decrypted) and only then can ssh use it. This |
33 |
is completely under the USER's control, who is free to protect or not |
34 |
protect the private key as they feel like. sshd on the server is unable |
35 |
to enforce or influence this in any way. |
36 |
|
37 |
Secondly, the statement "use this ssh key to connect to the system it |
38 |
was created for" is nonsensical. A key pair has two components - public |
39 |
and private keys, and the only thing sshd cares about is whether the |
40 |
user connecting has the matching private key to the public one sshd can |
41 |
read locally. The user is free to use that public key on as many or as |
42 |
few servers as he feels like, and again sshd is in no position to |
43 |
enforce or influence this. It is completely up to the user what he does |
44 |
with his keys. |
45 |
|
46 |
|
47 |
|
48 |
Perhaps you mean that on the server end the user's account has a |
49 |
password defined and sshd is configured to use PAM. The PAM config could |
50 |
require that the user authenticates successfully with ssh keys AND with |
51 |
the Unix password before logging the user in. This can be done, but it |
52 |
is not a common configuration and does not ship out the box. It will |
53 |
also confuse the living daylights out of the average user who at least |
54 |
in my world is unable to differentiate between a local ssh prompt for a |
55 |
key passphrase, and a remote telnet prompt for a password... |
56 |
|
57 |
|
58 |
|
59 |
|
60 |
-- |
61 |
Alan McKinnon |
62 |
alan.mckinnon@×××××.com |