Can't find remote host with ssh connect attempt to remote server

Joined
May 27, 2021
Messages
1
Reaction score
0
Edit

Using Linux and remote ssh command (I've placed my public ssh key on the remote server to allow non-password prompted connects)
The following command runs fine from the Linux command line:

ssh root@remoteIP /usr/bin/ls

However, when the following is called from my perl script:

system("ssh root@remoteIP /usr/bin/ls");

Perl reports:

ssh: Could not resolve hostname root.remoteIP: Name or service not known

(remoteIP is the real IP address of the remote computer. Obviously, I need to tell Perl how to resolve the address?)
 
Joined
Sep 3, 2023
Messages
18
Reaction score
1
Dont think you meant interpolate the var @remoteIP. Its always helpful print out the command you mean to execute.
Perl:
my $cmd = 'ssh ...';
print "'$cmd'\n";
system($cmd);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Brocade Switch Perl Script 0
Net::SSH::Expect 7
ssh tullen 0
ssh tullen 20
Net::SFTP Fails, sftp OK 2
First Commercial Perl Program 30
First Commercial Perl Program 1
Problem using Net::SSH::Perl 4

Members online

No members online now.

Forum statistics

Threads
473,595
Messages
2,568,953
Members
44,020
Latest member
Pearlene46

Latest Threads

Top