File: EXAMPLES

package info (click to toggle)
mussh 1.0-1.1
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 224 kB
  • sloc: sh: 1,130; makefile: 36
file content (118 lines) | stat: -rw-r--r-- 4,004 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
	SITUATION A (using ssh-agent):
	You run mussh and ssh-agent loads your default rsa/dsa key.  You
	are prompted for your passphrase, you enter it, mussh executes
	the commands, kills ssh-agent, and exits.

[doughnut@extradot doughnut]$ mussh -h swing slide junglegym -c 'rpm -q emacs'
Need passphrase for /home/doughnut/.ssh/identity
Enter passphrase for doughnut@extradot.yourdomain.com:
Identity added: /home/doughnut/.ssh/identity (doughnut@extradot.yourdomain.com)
 
junglegym: package emacs is not installed
slide: package emacs is not installed
swing: package emacs is not installed




	SITUATION B (using passwords):
	You run mussh but don't have RSA/DSA keys set up.  When mussh connects
	to each host, it prompts you for the password.  After completing 
	the last host, mussh exits.

[doughnut@extradot doughnut]$ mussh -h swing slide junglegym -c 'rpm -q emacs'
/home/doughnut/.ssh/identity: No such file or directory
 
doughnut@junglegym's password:
junglegym: package emacs is not installed
doughnut@slide's password:
slide: package emacs is not installed
doughnut@swing's password:
swing: package emacs is not installed





	SITUATION C (ssh-agent already running):
	If you are already running ssh-agent with the keys loaded, mussh 
	will not load keys unless you tell it to with the -i flag.

[doughnut@extradot doughnut]$ mussh -h swing slide junglegym -c 'rpm -q emacs'
 
junglegym: package emacs is not installed
slide: package emacs is not installed
swing: package emacs is not installed





	SITUATION D (everything but a goat):
	This example uses almost everything you could.  Specifying hosts
	on the command line AND in a file with comments and blank lines, 
	executing commands from the command line and from a file, forcing
	a unique agent to be loaded, using multiple keys (both RSA and DSA),
	and turing debug mode on for verbose output.

[doughnut@extradot doughnut]$ cat dev/spfiles/testhosts
dave@hobo
#test@testhost

merrygoround
[doughnut@extradot doughnut]$ cat dev/spfiles/testscript
date
uptime

[doughnut@extradot doughnut]$ mussh -a -i $HOME/.ssh/identity $HOME/.ssh/id_dsa -d -h swing slide -H dev/spfiles/testhosts -h junglegym -c 'rpm -q emacs' -C dev/spfiles/testscript
DEBUG: Starting Agent
DEBUG: Forcing SSH Agent
DEBUG: Adding Keys
Need passphrase for /home/doughnut/.ssh/identity
Enter passphrase for doughnut@extradot.yourdomain.com:
Identity added: /home/doughnut/.ssh/identity (doughnut@extradot.yourdomain.com)
Need passphrase for /home/doughnut/.ssh/id_dsa
Enter passphrase for /home/doughnut/.ssh/id_dsa:
Bad passphrase, try again:
Identity added: /home/doughnut/.ssh/id_dsa (/home/doughnut/.ssh/id_dsa)

DEBUG: CONNECT junglegym
junglegym: Wed Jun 27 18:34:37 PDT 2001
junglegym:   6:34pm  up 19 days, 18:46,  1 user,  load average: 0.00, 0.00, 0.00
junglegym: package emacs is not installed
DEBUG: CONNECT dave@hobo
dave@hobo: Wed Jun 27 18:35:35 PDT 2001
dave@hobo:   6:35pm  up 20 days, 19:54, 11 users,  load average: 0.00, 0.00, 0.00
dave@hobo: package emacs is not installed
DEBUG: CONNECT merrygoround
merrygoround: Wed Jun 27 18:35:27 PDT 2001
merrygoround:   6:35pm  up 20 days, 19:53,  1 user,  load average: 0.22, 0.11, 0.03
merrygoround: emacs-20.5-7
DEBUG: CONNECT slide
slide: Wed Jun 27 18:35:32 PDT 2001
slide:   6:35pm  up 19 days, 17:40,  4 users,  load average: 0.00, 0.00, 0.00
slide: package emacs is not installed
DEBUG: CONNECT swing
swing: Wed Jun 27 18:36:15 PDT 2001
swing:   6:36pm  up 20 days, 19:54,  3 users,  load average: 0.00, 0.00, 0.00
swing: package emacs is not installed
DEBUG: Removing keys from agent
DEBUG: Stopping Agent




	SITUATION E (asynchronous mode with ssh-agent already running):
	Asynchronous mode (-m) allows you to get done a lot quicker by
	not having to wait for one host to finnish before moving on to
	the next.


[doughnut@shoe mussh]$ mussh -h swing slide junglegym -c 'echo hello ; sleep 2 ; echo bye' -m2
junglegym: hello
slide: hello
junglegym: bye
swing: hello
slide: bye
swing: bye