LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 03-25-2010, 04:08 AM   #1
KavithaAshok
LQ Newbie
 
Registered: Mar 2010
Posts: 1

Rep: Reputation: 0
Lightbulb 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.
 
Old 03-25-2010, 08:06 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by KavithaAshok View Post
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
failed to execute login command charlie_lab Slackware 2 06-28-2009 01:09 PM
How to execute some command on GDM Login and Logout? jabran Linux - Desktop 2 08-24-2006 10:55 AM
how do i execute binary on ssh login? fobster Linux - General 5 05-26-2006 06:00 PM
.bashrc doesn't execute on ssh login rose_bud4201 Linux - Software 2 06-01-2005 08:28 AM
SSH: execute one command then exit kleptophobiac Linux - Software 10 01-30-2004 08:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration