[erlang-questions] ssh: only one key in authorized_keys?

Arndt Jonasson arndt@REDACTED
Mon Mar 31 09:26:22 CEST 2008


When using OTP's sshd implementation, only the first key in the
"authorized_keys" file seems to be looked at. The function
ssh_file:lookup_user_key_fd looks like this:

lookup_user_key_fd(Fd, Alg) ->
    case io:get_line(Fd, '') of
	eof ->
	    {error, not_found};
	Line ->
	    case string:tokens(Line, " ") of
		[Alg, KeyData, _] ->
		    decode_public_key_v2(ssh_bits:b64_decode(KeyData), Alg);
		_Other ->
		    ?dbg(false, "key_fd Other: ~w ~w\n", [Alg, _Other]),
		    lookup_user_key_fd(Fd, Alg)
	    end
    end.

i.e., when it finds one line containing three space-separated fields,
that must be the key.

Doesn't this render the use of SSH much less useful, or am I missing
something?

(I'm using an earlier version, but the code above is in OTP R12 as well.)



More information about the erlang-questions mailing list