mmretail / parallel-ssh

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

motd being printed only on debian squeeze boxes #87

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Using pssh with the -I option to read commands from stdin. Only on Debian 
Squeeze hosts, the motd is (undesirably) included in the output. Not so for 
Debian Etch hosts (and any other OS I've tried)

    $ echo "hostname" | pssh --inline-stdout -t 60 -H root@server1 -H root@server2 -I
    [1] 17:18:24 [SUCCESS] root@server1
    Hardware => Physical (X9SCL/X9SCM) (CPU: 8, MEM: 15.62 GB)
    OS       => Debian GNU/Linux 6.0.6 (squeeze) (Kernel: 3.2.2-hw2)
    server1
    [2] 17:18:25 [SUCCESS] root@server2
    server2

Doesn't happen without -I  (and I assure you server2 does have a motd)

    $ pssh --inline-stdout -t 60 -H root@server1 -H root@server2 "hostname"
    [1] 17:18:48 [SUCCESS] root@server1
    server1
    [2] 17:18:48 [SUCCESS] root@server2
    server2

Original issue reported on code.google.com by jon...@gmail.com on 2 Jul 2013 at 8:13

GoogleCodeExporter commented 8 years ago
Have same issue on AIX box running openssh with latest pssh: pssh-2.3-1

[root@host:] pssh -H server -t 10 -i "uptime"
[1] 09:46:49 [SUCCESS] server
  09:46AM   up 29 days,  14:34,  2 users,  load average: 0.38, 0.41, 0.45

[root@host:] pssh -H server -t 10 --inline-stdout -I         
uptime
[1] 09:47:27 [SUCCESS] server
****************************************************************************
*       Welcome to AIX version 6.1!                        *
****************************************************************************
[YOU HAVE NEW MAIL]
  09:47AM   up 29 days,  14:35,  2 users,  load average: 0.54, 0.46, 0.46

Original comment by mazh...@gmail.com on 18 Jul 2013 at 7:51

GoogleCodeExporter commented 8 years ago
The motd is probably caused by something in the /etc/ssh/sshd_config file. 
That's my guess, anyway. I'm sure that pssh isn't creating it, so it's 
definitely something in ssh.

Original comment by amcna...@gmail.com on 18 Jul 2013 at 4:45

GoogleCodeExporter commented 8 years ago
Thanks for the answer, you are right the PrintMotd option is the problem.
On the current environment I am unable to disable that. 

Is there any possibility to create a option that would create a .hushlogin file 
before the interactive connection? 

I don't want to create a .hushlogin file permanently just for a run of some 
scripts / checks. 

E.g. 

pssh -I --hush would first run in -i checking if there is a ~/.hushlogin and 
generating ~/.hushlogin file if not (preferably with some note that it was done 
from pssh) after that it would run in the -I option, on the end it would go 
again to -i and removing the ~/.hushlogin files that it generated. 

Original comment by mazh...@gmail.com on 19 Jul 2013 at 8:36

GoogleCodeExporter commented 8 years ago
I think that's really outside the scope of what pssh can or should do.

One other idea you might try is to add the following options to pssh: -x "-T"

This will make pssh pass the "-T" option to ssh, which might possibly help 
(though I'm really not sure).

Original comment by amcna...@gmail.com on 19 Jul 2013 at 4:26