Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7699489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:29:25+00:00 2026-05-31T22:29:25+00:00

Hi I am trying to get a connection from windows a unix box and

  • 0

Hi I am trying to get a connection from windows a unix box and just pass an ls command. The execution just hangs without any output. What might be wrong?

#!/usr/bin/perl -w
use strict;

use Net::SSH::Perl;

my $hostname = "unixhost";
my $username = "####";
my $password = "######";

my $cmd = shift;


my $ssh = Net::SSH::Perl->new("$hostname", debug=>1,  identity_files => []);
$ssh->login("$username","$password");
my ($stdout,$stderr,$exit) = $ssh->cmd("$cmd");
print $stdout;
exit;

*> C:>perl ssh.pl “ls -ltr”
WXVM0026: Reading configuration data

c:/.ssh/config WXVM0026: Reading configuration data /etc/ssh_config
WXVM0026: Connecting to themse, port 22. WXVM0026: Remote protocol
version 1.99, remote software version
OpenSSH_4.5p1+sftpfilecontrol-v1.1-hpn12v14 WXVM0026: Net::SSH::Perl
Version 1.34, protocol version 1.5. WXVM0026: No compat match:
OpenSSH_4.5p1+sftpfilecontrol-v1.1-hpn12v14. WXVM0026: Connection
established. WXVM0026: Waiting for server public key. WXVM0026:
Received server public key (768 bits) and host key (1024 bits).
WXVM0026: Host ‘themse’ is known and matches the host key. WXVM0026:
Encryption type: DES3 WXVM0026: Sent encrypted session key. WXVM0026:
Received encryption confirmation. WXVM0026: Doing challenge response
authentication. Password: Password: WXVM0026: Sending command: ls -ltr
WXVM0026: Entering interactive session.*

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T22:29:26+00:00Added an answer on May 31, 2026 at 10:29 pm

    If the remote command does not close its input/output/stederr the SSH session waits for its input forever (at least until its timeoouts).

     my $cmd = "ls / 0<&- 1>&- 2>&-";
    

    Regards,

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When trying to make a http connection on my windows machine I get the
i am trying to get the remote access from windows system to linux system
I'm trying to upload Solr index from a CSV on a windows box to
I'm trying to get a std::string from my database using mysql connexion Here is
I am trying to get the IP of a socket connection in string form.
I am currently trying to get my server to create a connection with a
I'm trying to get to grips with regular expressions: I have a database connection
I'm trying get the visible portion of UIImage from an UIImageView . UIImageView takes
I am trying to use QSerialDevice in Qt to get a connection to my
I'm trying to connect to my phone from my Windows 7 PC using PySerial

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.