Skip Menu |

This queue is for tickets about the Net-OpenSSH CPAN distribution.

Report information
The Basics
Id: 104944
Status: rejected
Priority: 0/
Queue: Net-OpenSSH

People
Owner: Nobody in particular
Requestors: JORISD [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.64
Fixed in: (no value)



Subject: Net::OpenSSH with Wrapper remote Shell
Hello, I'm not so sure about if it is a bug or not, sorry about it. I don't have much knowledge about SSH, terminals, etc.. However, I think there's something weird happening when I use Net::OpenSSH to remotely connect to a server (kind of a appliance) that starts a Wrapper shell instead of a regular shell. Net::OpenSSH doesn't send any command I ask to send : it is like the remote Wrapper shell wasn't controller by Net::OpenSSH. Instead, my terminal have access to the remote Wrapper shell ! I have the feeling I could use Expect to script around, but I'm not sure and I'd prefer to not use Expect if possible. I've added a typescript script, that you can replay with $ scriptreplay -t timinfile typescript Does that ring a bell to you ? Best regards, Joris
Subject: example.pl
#!/usr/bin/env perl use Data::Dumper; use Modern::Perl '2014'; use Net::OpenSSH; use Net::SFTP::Foreign; use IO::Pty; my @hosts = qw/ 2102310yjv10f1000181.company.lom /; my %ssh; for my $host (@hosts) { $ssh{$host} = Net::OpenSSH->new($host, user => 'root', password => 'secret', async => 1, ); } for my $host (@hosts) { my $status = $ssh{$host}->system("top"); say $status; }
Subject: timinfile
Download timinfile
application/octet-stream 537b

Message body not shown because it is not plain text.

Subject: typescript
Download typescript
application/octet-stream 851b

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #104944] Net::OpenSSH with Wrapper remote Shell
Date: Thu, 4 Jun 2015 13:13:42 +0000 (UTC)
To: "bug-Net-OpenSSH [...] rt.cpan.org" <bug-Net-OpenSSH [...] rt.cpan.org>
From: Salvador Fandino <sfandino [...] yahoo.com>
Show quoted text
> Hello, > > I'm not so sure about if it is a bug or not, sorry about it. I don't > have much knowledge about SSH, terminals, etc.. > > However, I think there's something weird happening when I use Net::OpenSSH > to remotely connect to a server (kind of a appliance) that starts a Wrapper > shell instead of a regular shell. > > Net::OpenSSH doesn't send any command I ask to send : it is like the remote > Wrapper shell wasn't controller by Net::OpenSSH. >
Show quoted text
> Instead, my terminal have access to the remote Wrapper shell !
That indicates that the shell wrapper is ignoring the -c option used by the SSH daemon to pass it the remote command. When you ask Net::OpenSSH to run some command as for instance 'ls /tmp', it results in sshd invoking '/bin/foosh -c "ls /tmp"' in the remote machine where "/bin/foosh" is the remote shell or wrapper. Well, actually there is another possibility. The shell wrapper could be configured via the sshd ForceCommand directive that follows a different protocol to pass the command (via the environment variable SSH_ORIGINAL_COMMAND). In any case, this is an issue with the wrapper and the sshd configuration. Show quoted text
> I have the feeling I could use Expect to script around, but I'm not sure and > I'd prefer to not use Expect if possible.
Expect would be your only option until the shell wrapper is fixed to behave properly.