ssh to multiple servers in seperate tabs in Konsole with one?bookmark or script?

Stephen Dowdy sdowdy at
Thu Aug 7 02:14:07 BST 2008

JW wrote, On 08/06/2008 05:47 PM:


fwiw, here's a framework (no error checking, buggy) based upon the
scripts i sent out earlier for a scripted "Mega Konsole" that i think
does what you want.  There are security implications of the "--script"
option to 'konsole' (i don't know what they all are and the extent of
access control to the session).  Also, this doesn't do cool things like
clusterssh where you can actually do non-blocked editing of files, etc,
but from your description of using "Send Input to all Sessions", i
don't think you need that.  (i *think* your issue about having to
send-all a password to 'su'/'sudo' should work if you do it right
and don't use the while-loop list of commands to exec.)


sdowdy at spudnut:~/bin$ cat konssh3
# Title: mega-konssh
# Description: create a scriptable konsole with many session tabs
# Author: Stephen Dowdy (sdowdy at
# Caveats:  work-in-progress

host_list="root at host1 root at host2 root at host3 joe at host4 mary at host5"

# Create the MainWindow....
konsole \
    --script \
    --caption "Bungload of Sessions" \
    --T "Bungload of Sessions" \
    --nomenubar \
    --vt_sz 132x42 \
    --noclose \

for session in ${host_list}; do
  sid=$(dcop ${KID} konsole newSession)
  dcop ${KID} ${sid} renameSession "${session}" 
  dcop ${KID} ${sid} sendSession "ssh $session"

# close the now useless first session
dcop ${KID} session-1 closeSession

dcop ${KID} konsole sendAllSessions "echo 'Hello World'"

# Run our list of commands across all session tabs
while read command; do
  dcop ${KID} konsole sendAllSessions ${command}
cp /etc/passwd /etc/
sed -i -e 'g/^bob:/d' /etc/passwd
echo "that wasn't very smart"

echo "You can now do things like:"
echo 'dcop ${KID} konsole sendAllSessions "shutdown -h now"'

exit 0

Stephen Dowdy  -  Systems Administrator  -  NCAR/RAL
303.497.2869   -  sdowdy at        -

This message is from the kde mailing list.
Account management:
More info:

More information about the kde mailing list