View Issue Details

IDProjectCategoryView StatusLast Update
1695RackTablesdefaultpublic2016-10-26 16:07
Reportermelpheos Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformLinuxOSCentOSOS Version6.8
Product Version0.20.11 
Summary1695: sshnokey working but not when ran through GUI to cisco switches
DescriptionI can use telnet for a few switches for when using sshnokey i get constantly the following error
sshnokey error: muxserver_listen bind(): Permission denied Couldn't establish SSH connection: unable to establish master SSH connection: bad password or master process exited unexpectedly at ./sshnokey line 75

The switch doesn't register a failed attempt

When running
./sshnokey ip.of.sw.itch --prompt=\# --username=sshuser --password='somepassword&'

i can then run some cisco command and get a result.

If i do the same command above with a wrong password, i get the same error and
the switch registers a failed attempt.

My param file is quite simple

{
        // servers and Juniper routers use ssh, other - telnet
        {
                $params[0]['protocol'] = 'sshnokey';
                $params[0]['username'] = 'sshuser';
                $params[0]['password'] = 'somepassword&';
                $params[0]['timeout'] = 30;
        }
}

debug is enabled in the file but i couldn't find any additional information.
Not sure what i'm missing here (not sure where the debug file is either)

TagsNo tags attached.

Activities

melpheos

melpheos

2016-10-21 16:03

reporter   ~0003487

Correction : the switche actualy receive a login success when running through GUI so the main issue seems to be "master process exited unexpectedly"
melpheos

melpheos

2016-10-21 17:04

reporter   ~0003489

With the help of some website i rewrote the sshnokey to the following

#ADDED
my $ssh_debug = 3; # verbose logging: 0-3
my $session_log_name = "ssh_$op_host.log";
open ( my $session_log_fh, ">", '/tmp/sshdebug')
or die "Failed to create logfile $session_log_name: $!";
binmode ($session_log_fh, ":unix"); # unbuffer log file
#ADDED

my $ssh = Net::OpenSSH->new(
        $op_host,
master_opts => ($ssh_debug)
        ? [ -o => "StrictHostKeyChecking=no", "-" . "v" x $ssh_debug ]
        : [ -o => "StrictHostKeyChecking=no" ],
        'port' => $op_port,
        'user' => $op_username,
        'password' => $op_password,
       master_stderr_fh => $session_log_fh,
);

This gave me the following in the debug file

debug3: muxserver_listen: temporary control path /var/www/.libnet-openssh-perl/sshuser-someip-19110-172343.iGoOdXvzB7VV5bNR
muxserver_listen bind(): Permission denied

Investigating
infrastation

infrastation

2016-10-23 15:11

administrator   ~0003491

Looks like the Perl library assumes it can create temporary files in the current directory whereas in fact it cannot (and should not be able to, generally speaking). Someone would need to tell it to use the standard temporary directory or call tmpnam(3).
melpheos

melpheos

2016-10-24 14:18

reporter   ~0003493

Last edited: 2016-10-24 15:47

Yes this what i assumed but for some reason changing the directory in the ssh-config doesn't do anything and the directory stays the same :-/

Installed everything on a centos 7 expecting this was a library bug but got the same result and same error message.

If there is a distrib on which it work straight away i will take it :)

melpheos

melpheos

2016-10-24 16:20

reporter   ~0003495

Found the issue, you have to set perm to 700 (this was done already) but also give the control path folder ownership to apache:apache (or whomever the user running apache)

Issue History

Date Modified Username Field Change
2016-10-21 15:58 melpheos New Issue
2016-10-21 16:03 melpheos Note Added: 0003487
2016-10-21 17:04 melpheos Note Added: 0003489
2016-10-23 15:11 infrastation Note Added: 0003491
2016-10-24 14:18 melpheos Note Added: 0003493
2016-10-24 14:27 melpheos Note Edited: 0003493
2016-10-24 14:27 melpheos Note Edited: 0003493
2016-10-24 15:47 melpheos Note Edited: 0003493
2016-10-24 16:20 melpheos Note Added: 0003495
2016-10-26 16:07 melpheos Status new => closed
2016-10-26 16:07 melpheos Resolution open => fixed