[erlang-patches] SSH: allow specifying 'auth_methods' in server opts

Stefan Zegenhagen <>
Thu Jun 28 11:07:50 CEST 2012


Dear all,

the 'auth_methods' option to the SSH server is still handled by the
code, but is not allowed to be specified in Opts. The patch below
corrects the issue.

--- snip ---

>From f71d45af6f3565cede4de444a0f8f691abbb5945 Mon Sep 17 00:00:00 2001
From: Stefan Zegenhagen <>
Date: Thu, 28 Jun 2012 11:02:45 +0200
Subject: [PATCH] SSH: Make "auth_methods" server option re-usable

The 'auth_methods' option is used by the server side of the SSH code to
tell a connecting SSH client about the authentication methods that are
supported by the server. The code still extracts and handles the
'auth_methods' option from Opts in appropriate places, but the Opts
checking code in ssh.erl didn't allow that option to be specified.
---
 lib/ssh/src/ssh.erl |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/ssh/src/ssh.erl b/lib/ssh/src/ssh.erl
index f4a40c8..85f5f68 100644
--- a/lib/ssh/src/ssh.erl
+++ b/lib/ssh/src/ssh.erl
@@ -369,6 +369,8 @@ handle_option([{shell, _} = Opt | Rest], SocketOptions, SshOptions) ->
     handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]);
 handle_option([{exec, _} = Opt | Rest], SocketOptions, SshOptions) ->
     handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]);
+handle_option([{auth_methods, _} = Opt | Rest], SocketOptions, SshOptions) ->
+    handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]);
 handle_option([Opt | Rest], SocketOptions, SshOptions) ->
     handle_option(Rest, [handle_inet_option(Opt) | SocketOptions], SshOptions).

@@ -408,6 +410,8 @@ handle_ssh_option({exec, {Module, Function, _}} = Opt) when is_atom(Module),
                                is_atom(Function) ->

     Opt;
+handle_ssh_option({auth_methods, Value} = Opt)  when is_list(Value) ->
+    Opt;
 handle_ssh_option({infofun, Value} = Opt)  when is_function(Value) ->
     Opt;
 handle_ssh_option({connectfun, Value} = Opt) when is_function(Value) ->
-- 
1.7.9.5

-- 
Dr. Stefan Zegenhagen

arcutronix GmbH
Garbsener Landstr. 10
30419 Hannover
Germany

Tel:   +49 511 277-2734
Fax:   +49 511 277-2709
Email: 
Web:   www.arcutronix.com

*Synchronize the Ethernet*

General Managers: Dipl. Ing. Juergen Schroeder, Dr. Josef Gfrerer -
Legal Form: GmbH, Registered office: Hannover, HRB 202442, Amtsgericht
Hannover; Ust-Id: DE257551767.

Please consider the environment before printing this message.



More information about the erlang-patches mailing list