scroogie / pdsh

Automatically exported from code.google.com/p/pdsh
0 stars 0 forks source link

Username not changing in pdsh #32

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

I'm using pdsh-2.26 but i am not able to change the remote username ( its 
always seem to use pdsh as username )

Blessed!![deepakka@seenmade:pdsh-2.26]$  pdsh -w 
ssh:deepakka@fatsi[01-02].ypost.sp1 "uname"

fatsi01: Permission denied, please try again.
fatsi02: Permission denied, please try again.
fatsi01: Permission denied, please try again.
fatsi02: Permission denied, please try again.
fatsi01: Permission denied (publickey,gssapi-with-mic,password).
pdsh@seenmade: fatsi01: ssh exited with exit code 255
fatsi02: Permission denied (publickey,gssapi-with-mic,password).
pdsh@seenmade: fatsi02: ssh exited with exit code 255

Blessed!![deepakka@seenmade:pdsh-2.26]$  pdsh -l deepakka -w 
ssh:fatsi[01-02].ypost.sp1 "uname"

fatsi02: Permission denied, please try again.
fatsi01: Permission denied, please try again.
fatsi02: Permission denied, please try again.
fatsi01: Permission denied, please try again.
fatsi02: Permission denied (publickey,gssapi-with-mic,password).
pdsh@seenmade: fatsi02: ssh exited with exit code 255
fatsi01: Permission denied (publickey,gssapi-with-mic,password).
pdsh@seenmade: fatsi01: ssh exited with exit code 255

What am i missing ?

#make check
:
:
# still have 1 known breakage(s)
# passed all remaining 14 test(s)
1..15
pdsh test suite complete.
116/121 tests passed.
2 broken tests failed as expected.
1 broken test now fixed.
1 test failed.
1 test skipped.
FAIL: runtests.sh
===================
1 of 1 tests failed
===================
make[3]: *** [check-TESTS] Error 1
make[3]: Leaving directory `/homes/deepakka/pdsh-2.26/tests'
make[2]: *** [check-am] Error 2
make[2]: Leaving directory `/homes/deepakka/pdsh-2.26/tests'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/homes/deepakka/pdsh-2.26/tests'
make: *** [check-recursive] Error 1

Original issue reported on code.google.com by optimis...@gmail.com on 4 Jun 2011 at 9:44

GoogleCodeExporter commented 8 years ago
I may have missed it, but where do you see that pdsh is trying to use the 
username "pdsh"?

You can try running

  pdsh -l user -w ssh:hosts... -q cmd

And make sure remote username is set to you username.

Note that if passwordless ssh isn't working you'll get errors like you are 
seeing above.

Original comment by mark.gro...@gmail.com on 4 Jun 2011 at 6:33

GoogleCodeExporter commented 8 years ago
I am also wondering which test is failing on your system. Can you attach the 
full output of "make check" ? 

Thanks!
markh

Original comment by mark.gro...@gmail.com on 4 Jun 2011 at 8:11

GoogleCodeExporter commented 8 years ago
@comment 1

I may have missed it, but where do you see that pdsh is trying to use the 
username "pdsh"?
> fatsi01: Permission denied (publickey,gssapi-with-mic,password).
pdsh@seenmade: fatsi01: ssh exited with exit code 255
This may not be username though..

Note that if passwordless ssh isn't working you'll get errors like you are 
seeing above.
> Oh, I didn't know i had to set passwordless keyphrases on remote hosts  .. 
was wondering why couldn't it ask for password and use same for all hosts 

> make check
[deepakka@seenmade:pdsh-2.26]$ make check
Making check in src
make[1]: Entering directory `/homes/deepakka/pdsh-2.26/src'
Making check in common
make[2]: Entering directory `/homes/deepakka/pdsh-2.26/src/common'
make[2]: Nothing to be done for `check'.
make[2]: Leaving directory `/homes/deepakka/pdsh-2.26/src/common'
Making check in qsnet
make[2]: Entering directory `/homes/deepakka/pdsh-2.26/src/qsnet'
make[2]: Nothing to be done for `check'.
make[2]: Leaving directory `/homes/deepakka/pdsh-2.26/src/qsnet'
Making check in modules
make[2]: Entering directory `/homes/deepakka/pdsh-2.26/src/modules'
make  check-am
make[3]: Entering directory `/homes/deepakka/pdsh-2.26/src/modules'
make[3]: Nothing to be done for `check-am'.
make[3]: Leaving directory `/homes/deepakka/pdsh-2.26/src/modules'
make[2]: Leaving directory `/homes/deepakka/pdsh-2.26/src/modules'
Making check in pdsh
make[2]: Entering directory `/homes/deepakka/pdsh-2.26/src/pdsh'
make[2]: Nothing to be done for `check'.
make[2]: Leaving directory `/homes/deepakka/pdsh-2.26/src/pdsh'
make[2]: Entering directory `/homes/deepakka/pdsh-2.26/src'
make[2]: Nothing to be done for `check-am'.
make[2]: Leaving directory `/homes/deepakka/pdsh-2.26/src'
make[1]: Leaving directory `/homes/deepakka/pdsh-2.26/src'
Making check in tests
make[1]: Entering directory `/homes/deepakka/pdsh-2.26/tests'
Making check in test-modules
make[2]: Entering directory `/homes/deepakka/pdsh-2.26/tests/test-modules'
make  check-am
make[3]: Entering directory `/homes/deepakka/pdsh-2.26/tests/test-modules'
make  a.la b.la pcptest.la
make[4]: Entering directory `/homes/deepakka/pdsh-2.26/tests/test-modules'
make[4]: `a.la' is up to date.
make[4]: `b.la' is up to date.
make[4]: `pcptest.la' is up to date.
make[4]: Leaving directory `/homes/deepakka/pdsh-2.26/tests/test-modules'
make[3]: Leaving directory `/homes/deepakka/pdsh-2.26/tests/test-modules'
make[2]: Leaving directory `/homes/deepakka/pdsh-2.26/tests/test-modules'
make[2]: Entering directory `/homes/deepakka/pdsh-2.26/tests'
make  check-TESTS
make[3]: Entering directory `/homes/deepakka/pdsh-2.26/tests'
*** t0001-basic.sh ***
ok 1 - working success
not ok 2 - pretend known breakage # TODO known breakage
ok 3 - pretend we have fixed a known breakage (run in sub test-lib)
ok 4 - test runs if prerequisite is satisfied
ok 5 - tests clean up after themselves
ok 6 - tests clean up even on failures
ok 7 - pdsh runs
ok 8 - pdsh -V works
ok 9 - pdsh -L works
ok 10 - pdsh -h works
ok 11 - rcmd/exec module is built
ok 12 - pdsh -N option works
ok 13 # skip -u option is functional (missing LONGTESTS)
ok 14 - -f sets fanout
ok 15 - -l sets remote username
ok 16 - too long username fails gracefully
ok 17 - -t sets connect timeout
ok 18 - -u sets command timeout
ok 19 - command timeout 0 by default
ok 20 - -b enables batch mode
ok 21 - pdsh -N option works
# still have 1 known breakage(s)
# passed all remaining 20 test(s)
1..21
*** t0002-internal.sh ***
ok 1 - working xstrerrorcat
ok 2 - working pipecmd
# passed all 2 test(s)
1..2
*** t0003-wcoll.sh ***
ok 1 - hostname range expansion works
ok 2 - host range expansion does not strip leading zeros
ok 3 - host range expansion handles mixed size suffixes
ok 4 - host range expansion works with "," embedded in range
ok 5 - host range expansion works with 2 sets of brackets
ok 6 - pdsh -x option works
ok 7 - pdsh -x option works with ranges
ok 8 - pdsh -x option works with ranges (gnats:118)
ok 9 - pdsh -x option works with non-numeric suffix (gnats:120)
ok 10 - pdsh -w- reads from stdin
ok 11 - pdsh -w- can be used with other -w args
ok 12 - WCOLL environment variable works
ok 13 - ranges can be embedded in wcoll files
ok 14 - ^file works
ok 15 - -x ^file works
ok 16 - ^file works with other args
ok 17 - Multiple ^file args
ok 18 - Multiple -w^file
ok 19 - -^file excludes hosts in file
ok 20 - ^file errors out if file doesnt exist
ok 21 - host exclusion with "-" works
ok 22 - regex filtering works
ok 23 - regex exclusion works
ok 24 - regex exclusion works from -x
ok 25 - multiple -w options
# passed all 25 test(s)
1..25
*** t0004-module-loading.sh ***
ok 1 - PDSH_MODULE_DIR functionality
ok 2 - module A takes precedence over B
ok 3 - pdsh -M B ativates module B
ok 4 - PDSH_MISC_MODULES option works
ok 5 - -M option overrides PDSH_MISC_MODULES environment var
ok 6 - pdsh help string correctly displays options of loaded modules
ok 7 - Loading conflicting module with -M causes error
ok 8 - Conflicting modules dont run init()
ok 9 - Force loaded module runs init()
ok 10 - New conflicting module does not run init() with -M
# passed all 10 test(s)
1..10
*** t0005-rcmd_type-and-user.sh ***
ok 1 - pdsh -l sets username for all hosts
ok 2 - Can set remote username via user@hosts
ok 3 - user@hosts works for a subset of hosts
ok 4 - Can set rcmd_type via rcmd_type:hosts
ok 5 - Can set rcmd_type and user via rcmd_type:user@hosts
# passed all 5 test(s)
1..5
*** t0006-pdcp.sh ***
ok 1 - Creating pdcp link to pdsh binary
ok 2 - Creating rpdcp link to pdsh binary
ok 3 - pdcp runs
ok 4 - rpdcp runs
ok 5 - pdcp -V works
ok 6 - pdcp -q works
ok 7 - -e sets remote program path
ok 8 - PDSH_REMOTE_PDCP_PATH sets remote program path
ok 9 - -f sets fanout
ok 10 - -l sets remote username
ok 11 - -t sets connect timeout
ok 12 - -u sets command timeout
ok 13 - command timeout 0 by default
ok 14 - Have pcptest rcmd module
ok 15 - pdcp basic functionality
ok 16 - rpdcp basic functionality
ok 17 - initialize directory tree
ok 18 - pdcp -r works
ok 19 - rpdcp -r works
# passed all 19 test(s)
1..19
*** t1001-genders.sh ***
# passed all 0 test(s)
1..0 # SKIP skipping genders tests, genders module not available
*** t1002-dshgroup.sh ***
# passed all 0 test(s)
1..0 # SKIP skipping dshgroups tests, dshgroup module not available
*** t1003-slurm.sh ***
# passed all 0 test(s)
1..0 # SKIP skipping slurm tests, slurm module not available
*** t2000-exec.sh ***
ok 1 - exec module works
ok 2 - exec cmd substitution works 
ok 3 - exec module works in interactive mode
ok 4 - exec cmd susbstitution works interactive mode
# passed all 4 test(s)
1..4
*** t2001-ssh.sh ***
ok 1 - create ssh dummy script
ok 2 - ssh module runs
ok 3 - ssh dummy script works
ok 4 - ssh works with DSHPATH
not ok - 5 have ssh connect timeout option
#
#               SSH_CONNECT_TIMEOUT_OPTION=$(sed -ne "s/#define 
SSH_CONNECT_TIMEOUT_OPTION \"\(.*\)\"/\1/p" ${PDSH_BUILD_DIR}/config.h) &&
#               test -n "$SSH_CONNECT_TIMEOUT_OPTION"
#
ok 6 - ssh works with connect timeout
ok 7 - ssh and pdcp work together
ok 8 - PDSH_SSH_ARGS works
ok 9 - PDSH_SSH_ARGS does not require %h
ok 10 - PDSH_SSH_ARGS does not require %u
ok 11 - PDSH_SSH_ARGS without %u inserts %u before %h
ok 12 - PDSH_SSH_ARGS does not require %u or %h
ok 13 - PDSH_SSH_ARGS_APPEND works
ok 14 - PDSH_SSH_ARGS_APPEND are added to PDSH_SSH_ARGS
ok 15 - interactive mode works with ssh (Issue 14)
ok 16 - create ssh dummy script for exit code testing
ok 17 - ssh dummy script is functional
ok 18 - ssh works with pdsh -S
ok 19 - ssh works with pdsh -S and multiple targets
# failed 1 among 19 test(s)
1..19
*** t5000-dshbak.sh ***
ok 1 - dshbak functionality
ok 2 - dshbak -c does not coalesce different length output
ok 3 - dshbak -c properly compresses multi-digit suffixes
ok 4 - dshbak -c properly compresses prefix with embedded numerals
ok 5 - dshbak -c does not strip leading zeros
ok 6 - dshbak -c does not coalesce different zero padding
ok 7 - dshbak -c properly coalesces zero padding of "00"
ok 8 - dshbak -c can detect suffixes
not ok 9 - dshbak -c can detect suffix with numeral # TODO known breakage
ok 10 - issue 19: missing commas in dshbak header output
ok 11 - dshbak -d functionality
ok 12 - dshbak -f functionality
ok 13 - dshbak -f without -d fails
ok 14 - dshbak -d fails when output dir does not exist
ok 15 - dshbak -d fails gracefully for non-writable dir
# still have 1 known breakage(s)
# passed all remaining 14 test(s)
1..15
pdsh test suite complete.
116/121 tests passed.
2 broken tests failed as expected.
1 broken test now fixed.
1 test failed.
1 test skipped.
FAIL: runtests.sh
===================
1 of 1 tests failed
===================
make[3]: *** [check-TESTS] Error 1
make[3]: Leaving directory `/homes/deepakka/pdsh-2.26/tests'
make[2]: *** [check-am] Error 2
make[2]: Leaving directory `/homes/deepakka/pdsh-2.26/tests'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/homes/deepakka/pdsh-2.26/tests'
make: *** [check-recursive] Error 1

Thanks,
deepak

Original comment by optimis...@gmail.com on 4 Jun 2011 at 9:45

GoogleCodeExporter commented 8 years ago
Thank you. 

The prefix

 pdsh@host: ...

On your error messages is just a log msg prefix that indicates the message is 
coming from the pdsh process on 'host'  -  so that you don't get these messages 
confused with other output. 

Currently, pdsh doesn't support capturing a password and passing it off to ssh 
processes. Instead it is assumed you will set up keys  and an ssh-agent (or 
passwordless keys)   this may be supported in a future version. 

Also, you do not need to specify remote username if it the same as the user 
invoking pdsh. 

Original comment by mark.gro...@gmail.com on 4 Jun 2011 at 11:50

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Yep. This works after setting up ssh-agent.

[deepakka@seenmade:pdsh-2.26]$ pdsh -R ssh  -w ^/tmp/tsi "uname -a"
fatsi01.ypost.sp1: Linux fatsi01.ypost.sp1 2.6.9-78.ELsmp #1 SMP Wed Jul 9 
15:46:26 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux
fatsi02.ypost.sp1: Linux fatsi02.ypost.sp1 2.6.9-80.ELsmp #1 SMP Fri Jan 23 
16:28:06 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
fatsi01.ypost.re3: Linux fatsi01.ypost.re3 2.6.9-78.ELsmp #1 SMP Wed Jul 9 
15:46:26 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux
fatsi02.ypost.re3: Linux fatsi02.ypost.re3 2.6.9-78.ELsmp #1 SMP Wed Jul 9 
15:46:26 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux

So, this request is to support password caching, so that user need not depend 
on external utilities like ssh-agent. This would also help user execute 'sudo 
cmd' ( currently how to do this ?).

Thanks,
Deepak

Original comment by optimis...@gmail.com on 6 Jun 2011 at 6:46