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 05-28-2012, 03:55 AM   #1
jayantkp
LQ Newbie
 
Registered: May 2012
Posts: 3

Rep: Reputation: Disabled
Issue with wrapper for ssh which execute ssh.


ssh user@<ip> -o StrictHostKeyChecking=no ===> It works

But when I give option as below using API,

node.runCommand("-o StrictHostKeyChecking=no");

Command: [/usr/bin/ssh user@<ip> -o StrictHostKeyChecking=no]
Exit Code: 6

It treats the option as separate command. So command execution fails.

When I give the entire command as parameter to the API,

node.runCommand("ssh -o 'StrictHostKeyChecking no' user@<ip>

ssh user@<ip> ssh -o StrictHostKeyChecking no user@<ip>

it gives ssh error due to incorrect parameter.

Exit Code: 2

Unknown command: ssh

How can I overcome this as I do not want confirmation for my ssh command?
 
Old 05-28-2012, 04:45 AM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,720

Rep: Reputation: 1704Reputation: 1704Reputation: 1704Reputation: 1704Reputation: 1704Reputation: 1704Reputation: 1704Reputation: 1704Reputation: 1704Reputation: 1704Reputation: 1704
Hi,

this is not really a fix, but more of a workaround:
you could put the option in the users ~/.ssh/config

Evo2.
 
Old 05-28-2012, 05:05 AM   #3
Nominal Animal
Senior Member
 
Registered: Dec 2010
Location: Finland
Distribution: Xubuntu, CentOS, LFS
Posts: 1,723
Blog Entries: 3

Rep: Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948
Quote:
Originally Posted by jayantkp View Post
node.runCommand("-o StrictHostKeyChecking=no");
I don't know which language or environment you use, but perhaps you need to single-quote the option (to avoid it being interpreted by the shell)?

Quote:
Originally Posted by jayantkp View Post
node.runCommand("ssh -o 'StrictHostKeyChecking no' user@<ip>
Here you didn't use the = at all. Did you try

Code:
node.runCommand("ssh -o 'StrictHostKeyChecking=no' user@ip");
?
 
Old 05-28-2012, 05:17 AM   #4
jayantkp
LQ Newbie
 
Registered: May 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
I have tried the quote option, but the api is removing the quote option while execution, so command fails. Even if escaping also did not work.

Also tried with equal to option which did not work.
 
Old 05-28-2012, 05:57 AM   #5
jayantkp
LQ Newbie
 
Registered: May 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
Adding following entries to the .ssh/config worked for me.

cat ~/.ssh/config
Host *
StrictHostKeyChecking no

Change permission to 600 for this file. Now this is working fine. Thanks to all.
 
  


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
SSH/SSL wrapper SentralOrigin Linux - Software 4 03-17-2009 09:49 PM
[SSH] Issue logging in [SSH & Permissions] MD3 Linux - Networking 11 12-10-2006 10:25 AM
SSH wrapper for telnet login sardaukar_siet Linux - Software 3 11-02-2006 12:31 PM
Passwordless SSH with SSH commercial server and open ssh cereal83 Linux - General 7 04-18-2006 01:34 PM
ssh issue: /usr/bin/ssh -x -oFallBackToRsh no -l WeNdeL Linux - Software 1 03-04-2003 08:17 PM

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

All times are GMT -5. The time now is 11:10 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