Discussion:
[rancid] Setup SSH login method on a non-default port
Ricardo Ferreira
2014-08-04 13:16:03 UTC
Permalink
Hello everyone,
First of all, I am not sure if this is the right place to ask questions.

I am having an hard time configuring rancid to ssh into a zebra router
running on an non-default SSH port.
According to the manual, this works fine for telnet, but I see no
reference in regards to SSH.

/ //*add*// //*method*// //*<router*// //*name*// //*glob>*// //*{ssh}*// //*[{...}]*//
Defines, in order, the connection methods to use for a device
from the set {ssh, telnet, rsh}. Method telnet may have a
suffix, indicating an alternate TCP port, of the form ":port".

Note: Different versions of telnet treat the specification of a
port differently. In particular, BSD derived telnets do not do
option negotiation when a port is given. Some devices, Extreme
switches for example, have undesirable telnet default options
such as linemode. In the BSD case, to enable option negotiation
when specifying a port the method should be "{telnet:-23}" or
you should add "mode character" to .telnetrc. See //*telnet(1)*// for
more information on telnet command-line syntax, telnet options,
and .telnetrc.

Example: add method * {ssh} {telnet:-3000} {rsh}/


I have tried without success:
/add//method hostname {ssh: 2222}//
//and also adding the host with the correct port into //.ssh/config/

Results:
clogin error: Error: Connection Refused (ssh):

Do you know if rancid supports logging in via SSH into a non-default port?
Thanks for your time
--
- no title specified

Kind regards / Met vriendelijke groet / Saludos,

Ricardo Ferreira

Core IP Network

Elephant Talk Communications
Emmanuel Halbwachs
2014-08-04 14:32:24 UTC
Permalink
Hello,
Post by Ricardo Ferreira
I am having an hard time configuring rancid to ssh into a zebra
router running on an non-default SSH port.
[...]
Do you know if rancid supports logging in via SSH into a non-default port?
Why not do this at the ssh level? In your $HOME/.ssh/config:

Host zebra
HostName zebra.example.org
Port 2222

HTH,
--
Emmanuel Halbwachs Observatoire de Paris
Resp. Réseau/Sécurité/Infrastructure 5 Place Jules Janssen
tel : +33 1 45 07 75 54 F 92195 MEUDON CEDEX
véhicules (GPS) : face 32 av. Marcellin Berthelot
Paul Thornton
2014-08-04 14:59:57 UTC
Permalink
Post by Ricardo Ferreira
/add//method hostname {ssh: 2222}//
//and also adding the host with the correct port into //.ssh/config/
Do you know if rancid supports logging in via SSH into a non-default port?
Thanks for your time
I think you need to have this configured like:

add method router.hostname ssh:2222

(no space between the ssh: and the port number) and it should work.

Paul.

Loading...