LinuxQuestions.org
Visit Jeremy's Blog.
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, 05: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, 09:06 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,328

Rep: Reputation: 8089Reputation: 8089Reputation: 8089Reputation: 8089Reputation: 8089Reputation: 8089Reputation: 8089Reputation: 8089Reputation: 8089Reputation: 8089Reputation: 8089
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 02:09 PM
How to execute some command on GDM Login and Logout? jabran Linux - Desktop 2 08-24-2006 11:55 AM
how do i execute binary on ssh login? fobster Linux - General 5 05-26-2006 07:00 PM
.bashrc doesn't execute on ssh login rose_bud4201 Linux - Software 2 06-01-2005 09:28 AM
SSH: execute one command then exit kleptophobiac Linux - Software 10 01-30-2004 09:21 PM

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

All times are GMT -5. The time now is 07:26 PM.

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