Net::OpenSSH not working on Unix machine.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Net::OpenSSH not working on Unix machine.
# 1  
Old 03-21-2011
Net::OpenSSH not working on Unix machine.

So, I installed the Net::OpenSSH module and I am having trouble getting it to work. It appears to be failing on this code:

Code:
my $ssh = Net::OpenSSH->new('user:passwd@host.com');
$ssh->error and
die "Couldn't establish SSH connection: ". $ssh->error;

It's pretty simple code. I keep getting the response:

Code:
ssh: illegal option -- M
Usage: ssh [options] host [command]
Options:
  -l user     Log in using this user name.
  -n          Redirect input from /dev/null.
  -F config   Config file (default: ~/.ssh/config).
  -A          Enable authentication agent forwarding.
  -a          Disable authentication agent forwarding (default).
  -X          Enable X11 connection forwarding.
  -x          Disable X11 connection forwarding (default).
  -i file     Identity for public key authentication (default: ~/.ssh/identity)
  -t          Tty; allocate a tty even if command is given.
  -T          Do not allocate a tty.
  -v          Verbose; display verbose debugging messages.
              Multiple -v increases verbosity.
  -V          Display version number only.
  -q          Quiet; don't display any warning messages.
  -f          Fork into background after authentication.
  -e char     Set escape character; ``none'' = disable (default: ~).
  -c cipher   Select encryption algorithm
  -m macs     Specify MAC algorithms for protocol version 2.
  -p port     Connect to this port.  Server must be on the same port.
  -L listen-port:host:port   Forward local port to remote address
  -R listen-port:host:port   Forward remote port to local address
              These cause ssh to listen for connections on a port, and
              forward them to the other side by connecting to host:port.
  -D port     Enable dynamic application-level port forwarding.
  -C          Enable compression.
  -N          Do not execute a shell or command.
  -g          Allow remote hosts to connect to forwarded ports.
  -1          Force protocol version 1.
  -2          Force protocol version 2.
  -4          Use IPv4 only.
  -6          Use IPv6 only.
  -o 'option' Process the option as if it was read from a configuration file.
  -s          Invoke command (mandatory) as SSH2 subsystem.
  -b addr     Local IP address.
Couldn't establish SSH connection: unable to establish master SSH connection: ssh master exited unexpectedly at openssh.pl line 7.

It works fine on Ubuntu, but on my Unix machine running SunOS 5.10, it managed to give back the ssh usage message shown above.

Have anyone of you seen this before? Any idea as to what the solution is? I would try Net::SSH::Perl, but it's a pain to even get it on Linux, let alone a Unix machine where I have limited privileges.

Any and all responses will be appreciated.

---------- Post updated at 11:09 AM ---------- Previous update was at 09:58 AM ----------

Nevermind. I just found out that Net::OpenSSH requires later versions of openSSH, which I don't have.

Last edited by pludi; 03-21-2011 at 02:42 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl Net::IP not working

Experts - I have a snippet of code I can't figure out. I was hoping someone could help me here. I have a file of IPv6 address that I need to format correct. Example in: 2620:0:2d0:200::7 2620:0:2d0:200:a0:c 2620:0a:3f0:200:a0:c I need to convert them to:... (3 Replies)
Discussion started by: timj123
3 Replies

2. Solaris

Network of Virtual machine not working

Hello, I have a problem. I have a server SPARC T3-1 with solaris 11 on the base. The server is working well. And then i did a virtual machine using again Solaris 11 to do this, but now my notwork on my virtual machine is not working anymore. There says that the network that i have created is... (11 Replies)
Discussion started by: keziacp
11 Replies

3. Web Development

Ssh authentication from .NET webpage to UNIX is not working

My .NET website invokes a perl script to perform GIT operations on Gerrit server running UBuntu. In the perl script I connect using passwordless authentication to Gerrit server as below: system ( "ssh gitadmin@gerritserver.com 'cd /xyz && git clone xxx' "); I verified that ssh authentication... (3 Replies)
Discussion started by: tkota
3 Replies

4. UNIX and Linux Applications

Cygwin application not working on my machine.

I have windows XP machine. Today i have tried to install Cygwin, I've downloaded all the packages then ran the setup. It's showed completed. But when i try to open this it's not working. Do i need to do anything extra for this..? Please help... (3 Replies)
Discussion started by: pamu
3 Replies

5. Red Hat

how to install Openssh in linux machine

Hi genious i'm New to Linux .. help me Very Urgent how to install Openssh in linux machine step by step .... plz (3 Replies)
Discussion started by: coolboys
3 Replies

6. Shell Programming and Scripting

Library on Remote machine or $PATH is not working..

I don't know how to put this. However here is the problem. While executing command remotely on a Unix machine i get an error /usr/lib/hpux32/dld.so: Unable to find library 'libxerces-c.sl.21'. However when i execute the command on the remote machine locally. it works fine. Also i have... (2 Replies)
Discussion started by: suraj.sheikh
2 Replies

7. Shell Programming and Scripting

How to transfer files from unix machine to local machine using shell script?

Hi All.. Am new to Unix!! Am creating a shell script in which a scenario is like i have transfer the output file from unix machine (Server) to local directory (Windows xp). And also i have to transfer the input file from the local directory to Unix machine (Server) Any help from you... (1 Reply)
Discussion started by: vidhyaS
1 Replies

8. Shell Programming and Scripting

Net::SMTP via PERL is not working in few cases

We are getting some special scenarios where Net::SMTP is not working for some mails. we are sending a similar kind of data via mails but some of the mails are not received. After checking the Net::SMTP in debug mode we found below difference: Good One - (Mail sent properlly) --- -----... (0 Replies)
Discussion started by: NIMISH AGARWAL
0 Replies

9. UNIX for Dummies Questions & Answers

Trying to get mail working on a Linux machine

I tried using the mail command on one of our Linux machines to send email, and it works fine. I tried using the same command on another one of our Linux machines, and it didn't work (no error message was returned either). The machine that works has the following version information:... (2 Replies)
Discussion started by: sllinux
2 Replies

10. UNIX for Dummies Questions & Answers

Link type between working machine and server machine

There are two servers where my machine is connected. Is there any type of link formed between my machine and server machine? (1 Reply)
Discussion started by: palash2k
1 Replies
Login or Register to Ask a Question