asuka-sato / parallel-ssh

Automatically exported from code.google.com/p/parallel-ssh
Other
0 stars 0 forks source link

allow the -O option to be specified multiple times #25

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. Create a file with some hosts hosts e.g.
[soham@server.dc tmp]$ cat /tmp/servers
aaron.dev
bvanevery.dev

2. Create an identity file readable by current user, e.g.
[soham@server.dc tmp]$ ll /tmp/tmp.rkWOetj414
-rw------- 1 soham soham 1674 Oct 14 12:21 /tmp/tmp.rkWOetj414

3. Run pssh on them with any command, pass parameters which bypass strict 
hostkey verification and also pass in the identity file and notice the error 
e.g.:

[soham@server.dc tmp]$ /usr/bin/pssh -i -v -h /tmp/servers -O 
UserKnownHostsFile=/dev/null -O StrictHostKeyChecking=no -O 
IdentityFile=/tmp/tmp.rkWOetj414   "uptime"
[1] 20:59:46 [FAILURE] aaron.dev Exited with error code 255
Stderr: Permission denied.  Please create SSH keys or use the -A option to
provide a password.
Host key verification failed.
[2] 20:59:46 [FAILURE] bvanevery.dev Exited with error code 255
Stderr: Permission denied.  Please create SSH keys or use the -A option to
provide a password.
Host key verification failed.

What is the expected output? What do you see instead?

See above for output that I see. I expect to bypass host key verification, like 
it happens in usual ssh e.g.

[soham@server.dc tmp]$ ssh -o UserKnownHostsFile=/dev/null -o 
StrictHostKeyChecking=no -o IdentityFile=/tmp/tmp.rkWOetj414 aaron.dev "uptime"
Warning: Permanently added 'aaron.dev,10.8.10.140' (RSA) to the list of known 
hosts.
 21:01:42 up 217 days, 10:37,  0 users,  load average: 0.21, 0.12, 0.04

[soham@server.dc tmp]$ cat ~/.ssh/known_hosts | grep aaron.dev
[soham@server.dc tmp]$

What version of the product are you using? On what operating system?

pssh-2.1.1,  x86_64 GNU/Linux,  2.6.18-194.el5 #1 SMP

ssh -V : OpenSSH_5.3p1-hpn13v7, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008

Please provide any additional information below.

1. If I do not pass the IdentityFile, it does not cause this problem, but it 
doesn't seem to respect the UserKnownHostsFile either:

[soham@server.dc tmp]$ /usr/bin/pssh -i -v -h /tmp/servers -O 
UserKnownHostsFile=/dev/null -O StrictHostKeyChecking=no   "uptime"
[1] 20:59:21 [SUCCESS] aaron.dev
 20:59:12 up 217 days, 10:34,  0 users,  load average: 0.02, 0.07, 0.03
Stderr: Warning: Permanently added 'aaron.dev,10.8.10.140' (RSA) to the list of 
known hosts.
[2] 20:59:21 [SUCCESS] bvanevery.dev
 20:59:12 up 110 days, 20:00,  0 users,  load average: 0.00, 0.00, 0.00
Stderr: Warning: Permanently added 'bvanevery.dev,10.8.10.172' (RSA) to the 
list of known hosts.

2. Order of ssh-options doesn't matter

Original issue reported on code.google.com by soham.me...@gmail.com on 15 Oct 2010 at 4:16

GoogleCodeExporter commented 8 years ago
Please ignore this. It seems -O is not a multi-value argument and only the last 
one is picked up.

Original comment by soham.me...@gmail.com on 15 Oct 2010 at 9:18

GoogleCodeExporter commented 8 years ago
Hmm.  You should be able to specify it multiple times, so if this doesn't work, 
I think it's a bug.  I'll look at it later and try to reproduce it.

Original comment by amcna...@gmail.com on 15 Oct 2010 at 4:42

GoogleCodeExporter commented 8 years ago
Thanks for quick reply. 

I have a patch (attached). Works for both command line and environment variable 
PSSH_OPTIONS. Please comment?

Original comment by soham.me...@gmail.com on 16 Oct 2010 at 2:21

Attachments:

GoogleCodeExporter commented 8 years ago
This patch probably breaks backward compatibility with PSSH_OPTIONS env var. 
Wondering what you think. Thanks.

Original comment by soham.me...@gmail.com on 16 Oct 2010 at 2:27

GoogleCodeExporter commented 8 years ago
The environment variables definitely complicate things.  Anyway, thanks for 
posting a patch.  I'll try to look at it as soon as I can.

Original comment by amcna...@gmail.com on 16 Oct 2010 at 3:11

GoogleCodeExporter commented 8 years ago
Sorry for the delay.  I've applied the patch with a few modifications as commit 
735985.  In particular, I left out the ability for the PSSH_OPTIONS environment 
variable to have multiple options because I'm worried that there might be some 
legitimate ssh option containing a colon character.  In general, I hope people 
will use the command-line options when they need this.  Anyway, let me know if 
you have any thoughts or if you see any problems.  I plan on releasing a 
version 2.2 sometime this week that will include this fix.  Thanks for your 
help.

Original comment by amcna...@gmail.com on 9 Jan 2011 at 6:15

GoogleCodeExporter commented 8 years ago

Original comment by amcna...@gmail.com on 9 Jan 2011 at 6:19

GoogleCodeExporter commented 8 years ago
I'm going to mark this as fixed for now.  Please reopen if you see any problems 
with the fix.  Thanks.

Original comment by amcna...@gmail.com on 10 Jan 2011 at 2:37