Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
03-25-2010, 05:08 AM
|
#1
|
LQ Newbie
Registered: Mar 2010
Posts: 1
Rep:
|
Using 'say' to login SSH and execute command
My problem is:
sub init() {
$Test->description("Establishing the connection to the client");
eval {
$Host = host($CLIENT) or die($@);
$Conn = connect("#ssh") or die "Client connection Failed" . $@;
};
if ($@) {
$Log->error("Unable to instantiate the Objects for the Test" .
$@);
return $TCD::CONFIG;
}
return $TCD::PASS;
}## end sub init ()
Here I’m trying to connect windows machine using connect object which
is working fine. But when I tried to execute the command on Windows
machine from Linux machine by using:
my (undef, undef,$output,undef) = say ($Conn, "cmd /c $CMD_PATH\\smvi
backup create -id $ID_NUM -backup-name $backup_name -server $SERVER",
-timeout,$TIMEOUT);
it is asking the username and password even if I don’t execute the
command which has option ‘-user-‘. Can just let me know why its failing
when I use ssh.
|
|
|
03-25-2010, 09:06 PM
|
#2
|
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,328
|
Quote:
Originally Posted by KavithaAshok
My problem is:
sub init() {
$Test->description("Establishing the connection to the client");
eval {
$Host = host($CLIENT) or die($@);
$Conn = connect("#ssh") or die "Client connection Failed" . $@;
};
if ($@) {
$Log->error("Unable to instantiate the Objects for the Test" .
$@);
return $TCD::CONFIG;
}
return $TCD::PASS;
}## end sub init ()
Here I’m trying to connect windows machine using connect object which
is working fine. But when I tried to execute the command on Windows machine from Linux machine by using:
my (undef, undef,$output,undef) = say ($Conn, "cmd /c $CMD_PATH\\smvi
backup create -id $ID_NUM -backup-name $backup_name -server $SERVER", -timeout,$TIMEOUT);
it is asking the username and password even if I don’t execute the command which has option ‘-user-‘. Can just let me know why its failing when I use ssh.
|
Please use CODE tags. And it's failing, because Windows doesn't work the same way as Linux does. Without seeing all the code, and knowing what version/distro of Linux, and how SSH is working on Windows, it's hard to say.
|
|
|
All times are GMT -5. The time now is 07:26 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|