wouterdebie / i2cssh Goto Github PK
View Code? Open in Web Editor NEWcsshX like ssh tool for iTerm2
License: MIT License
csshX like ssh tool for iTerm2
License: MIT License
I'm wanting to layout my sessions on top of each other rather than next to each other. I assume this can be accomplished with the -C or the -R options. However, they aren't working as I'd expect. Am I missing something? Can I accomplish this differently?
When I try, for example,
i2cssh -m `printf "foo\nbar\nbaz"`
the first argument foo gets ignored and a window opens with connections to bar and baz. Not sure if this is supported – if not, I guess that makes this a feature request. :)
I get the following:
/Users/mike/.rvm/gems/ruby-1.9.2-p180/gems/rb-appscript-0.6.1/lib/_aem/aemreference.rb:34:in new': wrong argument type String (expected Module) (TypeError) from /Users/mike/.rvm/gems/ruby-1.9.2-p180/gems/rb-appscript-0.6.1/lib/_aem/aemreference.rb:34:in
pack_enum'
from /Users/mike/.rvm/gems/ruby-1.9.2-p180/gems/rb-appscript-0.6.1/lib/_aem/aemreference.rb:212
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in
require'
from /Users/mike/.rvm/gems/ruby-1.9.2-p180/gems/rb-appscript-0.6.1/lib/_aem/codecs.rb:12
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in
require'
from /Users/mike/.rvm/gems/ruby-1.9.2-p180/gems/rb-appscript-0.6.1/lib/aem.rb:17
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in
require'
from /Users/mike/.rvm/gems/ruby-1.9.2-p180/gems/rb-appscript-0.6.1/lib/appscript.rb:19
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:58:in gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:58:in
require'
from /Users/mike/.rvm/gems/ruby-1.9.2-p180/bin/i2cssh:3
When trying to run i2cssh.
i2cssh (0.0.10)
ruby -v - ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.7.0]
gem -v - 1.8.5
rb-appscript (0.6.1)
Hi, I have this command working via ssh-agent so that the private-host is accessed via a bastion host.
ssh -A -t bastion 'ssh user@private-host'
How do the equivalent using i2cssh -A option? Also I think i2cssh uses -t for something else.
This is on the latest macOS.
I try to use i2cssh (1.12.0), but when I open three sessions on remote hosts, the windows will open, but the login fails with the following error message:
➜ ~ i2cssh hman@cookie3 hman@cookie4 hman@cookie5
/Users/hman/.rvm/gems/ruby-2.1.1/extensions/x86_64-darwin-13/2.1.0/rb-appscript-0.6.1/appscript.rb:542:in `_send_command': CommandError (Appscript::CommandError)
OSERROR: -1719
MESSAGE: Can't get reference. Invalid index.
OFFENDING OBJECT: app("/Users/hman/Downloads/iTerm.app").terminals[6].sessions[2]
COMMAND: app("/Users/hman/Downloads/iTerm.app").terminals[6].sessions[2].write({:text=>"/bin/bash -l"})
from /Users/hman/.rvm/gems/ruby-2.1.1/extensions/x86_64-darwin-13/2.1.0/rb-appscript-0.6.1/appscript.rb:642:in `method_missing'
from /Users/hman/.rvm/gems/ruby-2.1.1/gems/i2cssh-1.12.0/lib/i2cssh.rb:113:in `block in start_ssh'
from /Users/hman/.rvm/gems/ruby-2.1.1/gems/i2cssh-1.12.0/lib/i2cssh.rb:112:in `upto'
from /Users/hman/.rvm/gems/ruby-2.1.1/gems/i2cssh-1.12.0/lib/i2cssh.rb:112:in `start_ssh'
from /Users/hman/.rvm/gems/ruby-2.1.1/gems/i2cssh-1.12.0/lib/i2cssh.rb:30:in `initialize'
from /Users/hman/.rvm/gems/ruby-2.1.1/gems/i2cssh-1.12.0/bin/i2cssh:192:in `new'
from /Users/hman/.rvm/gems/ruby-2.1.1/gems/i2cssh-1.12.0/bin/i2cssh:192:in `<top (required)>'
from /Users/hman/.rvm/gems/ruby-2.1.1/bin/i2cssh:23:in `load'
from /Users/hman/.rvm/gems/ruby-2.1.1/bin/i2cssh:23:in `<main>'
from /Users/hman/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
from /Users/hman/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
I am using ruby: ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin13.0]
Thank you.
Björn
Just converted to OSX Yosemite and this is what is get. I've tried uninstalling and reinstalling with gem, brew update, nothing works. Thanks!
i2cssh -l root server1 server2
/usr/local/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0/rb-appscript-0.6.1/_aem/connect.rb:89:in rescue in launch_application': OS error (-600) (Connect::CantLaunchApplicationError) from /usr/local/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0/rb-appscript-0.6.1/_aem/connect.rb:85:in
launch_application'
from /usr/local/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0/rb-appscript-0.6.1/_aem/connect.rb:182:in rescue in local_app' from /usr/local/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0/rb-appscript-0.6.1/_aem/connect.rb:177:in
local_app'
from /usr/local/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0/rb-appscript-0.6.1/aem.rb:146:in by_path' from /usr/local/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0/rb-appscript-0.6.1/appscript.rb:57:in
connect'
from /usr/local/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0/rb-appscript-0.6.1/appscript.rb:159:in reference_by_name' from /usr/local/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0/rb-appscript-0.6.1/appscript.rb:633:in
method_missing'
from /usr/local/lib/ruby/gems/2.1.0/gems/i2cssh-1.12.0/lib/i2cssh.rb:18:in initialize' from /usr/local/lib/ruby/gems/2.1.0/gems/i2cssh-1.12.0/bin/i2cssh:192:in
new'
from /usr/local/lib/ruby/gems/2.1.0/gems/i2cssh-1.12.0/bin/i2cssh:192:in <top (required)>' from /usr/local/bin/i2cssh:23:in
load'
from /usr/local/bin/i2cssh:23:in `
I see the error below.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin15/rbconfig.rb:213: warning: Insecure world writable dir /Applications/vault-cli-3.1.6 in PATH, mode 040777 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:296:in
to_specs': Could not find 'i2cssh' (>= 0) among 49 total gem(s) (Gem::LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:307:in to_spec' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in
gem'
from /usr/local/bin/i2cssh:22:in <main>'
rvm list gives me the list below
rvm list
rvm rubies
=* ruby-2.3.0 [ x86_64 ]
# => - current
# =* - current && default
# * - default
I am not sure what other information I can provide. Pretty new to Ruby and have no idea how to debug this.
I just installed it on Mac with iterm2 2.9.20160206 but got the following exception
i2cssh -m server1, server2
/Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:676:in `rescue in method_missing': Unknown property, element or command: 'create_window_with_profile' (RuntimeError)
from /Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:646:in `method_missing'
from /Library/Ruby/Gems/2.0.0/gems/i2cssh-2.0.0/lib/i2cssh.rb:20:in `initialize'
from /Library/Ruby/Gems/2.0.0/gems/i2cssh-2.0.0/bin/i2cssh:298:in `new'
from /Library/Ruby/Gems/2.0.0/gems/i2cssh-2.0.0/bin/i2cssh:298:in `<top (required)>'
from /usr/local/bin/i2cssh:23:in `load'
from /usr/local/bin/i2cssh:23:in `<main>'
To reproduce:
Is it possible to pass commands that will be executed on remote hosts? I have a few scripts that one of my coworkers wrote that will execute remote commands on a single host and I'd like to pair it with i2cssh so that I can it have it run the same set of commands on all hosts in the cluster.
Updated to iTerm 2 version 3.0.0 last night
Since then i2cssh is throwing the error below when I run the command
i2cssh -m username@server1,username@server2 -Xi=/path/to/private/key
/Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:177:in `block in pack': Unknown Keyword: :terminal (IndexError)
from /Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:177:in `fetch'
from /Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:177:in `pack'
from /Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/_aem/send.rb:37:in `block in initialize'
from /Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/_aem/send.rb:37:in `each'
from /Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/_aem/send.rb:37:in `initialize'
from /Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/aem.rb:218:in `new'
from /Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/aem.rb:218:in `event'
from /Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:506:in `_send_command'
from /Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:642:in `method_missing'
from /Library/Ruby/Gems/2.0.0/gems/i2cssh-1.16.0/lib/i2cssh.rb:19:in `initialize'
from /Library/Ruby/Gems/2.0.0/gems/i2cssh-1.16.0/bin/i2cssh:298:in `new'
from /Library/Ruby/Gems/2.0.0/gems/i2cssh-1.16.0/bin/i2cssh:298:in `<top (required)>'
from /usr/local/bin/i2cssh:23:in `load'
from /usr/local/bin/i2cssh:23:in `<main>
Here is a simple way to change the profile of spawned windows:
65c65
< @term.sessions[i].write :text => "unset HISTFILE && #{@ssh_prefix} #{server}"
---
> @term.sessions[i].write :text => "unset HISTFILE && echo -e \"\\033]50;SetProfile=Support\\a\" && #{@ssh_prefix} #{server}"
where the profile used is called 'Support'.
I'll try to submit a true patch if I get a chance but I don't know Ruby.
I am using i2cssh 2.2.0 with iTerm2 Build 3.0.15 on a Mac running macOS 10.12.5
I have a .i2csshrc that defines a cluster of 2 machines. I can use i2cssh to connect to this cluster just fine: it creates a new iTerm2 window, splits the window into two panes, with each pane connected to a host in the cluster.
However if I try to set either the number of columns by adding "--columns 60" to the command line, or by adding "columns: 60" to the cluster in my .i2csshrc it goes haywire:
As far as I can tell each pane is still showing the local Mac command prompt: it hasn't got as far as connecting to the remote host.
The same problem occurs when attempting to set the number of rows instead using either "--rows 40", or with "rows: 40" in the .i2csshrc
Changing focus from the newly created window back to the original (in which the i2cssh command was typed) causes that to start repeatedly splitting into smaller and smaller panes instead.
Typing a Ctrl/C into the window with the running i2cssh command causes it to abort and ends the repeated splitting, and giving this output:
^C/usr/local/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/_aem/send.rb:47:in `_send_apple_event': Interrupt
from /usr/local/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/_aem/send.rb:71:in `send'
from /usr/local/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:507:in `_send_command'
from /usr/local/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:642:in `method_missing'
from /usr/local/lib/ruby/gems/2.4.0/gems/i2cssh-2.2.0/lib/i2cssh.rb:103:in `block (2 levels) in split_session'
from /usr/local/lib/ruby/gems/2.4.0/gems/i2cssh-2.2.0/lib/i2cssh.rb:102:in `upto'
from /usr/local/lib/ruby/gems/2.4.0/gems/i2cssh-2.2.0/lib/i2cssh.rb:102:in `block in split_session'
from /usr/local/lib/ruby/gems/2.4.0/gems/i2cssh-2.2.0/lib/i2cssh.rb:101:in `upto'
from /usr/local/lib/ruby/gems/2.4.0/gems/i2cssh-2.2.0/lib/i2cssh.rb:101:in `split_session'
from /usr/local/lib/ruby/gems/2.4.0/gems/i2cssh-2.2.0/lib/i2cssh.rb:26:in `initialize'
from /usr/local/lib/ruby/gems/2.4.0/gems/i2cssh-2.2.0/bin/i2cssh:298:in `new'
from /usr/local/lib/ruby/gems/2.4.0/gems/i2cssh-2.2.0/bin/i2cssh:298:in `<top (required)>'
from /usr/local/bin/i2cssh:22:in `load'
from /usr/local/bin/i2cssh:22:in `<main>'
If you need any further information do please let me know.
Cheers,
Mike B-)
Hello,
What would be great is to open i2ssh shells in a new tab.
(I never remember how to switch window ^^)
Really not a high priority request, just a suggestion.
XL.
The --fullscreen
option doesn't work in Mountain Lion (10.8.4) with i2cssh 1.9.0
$ i2cssh --fullscreen host1 host2
/Library/Ruby/Gems/1.8/gems/rb-appscript-0.6.1/lib/appscript.rb:676:in `method_missing': Unknown property, element or command: 'desktop' (RuntimeError)
from /Library/Ruby/Gems/1.8/gems/i2cssh-1.9.0/lib/i2cssh.rb:37:in `maximize'
from /Library/Ruby/Gems/1.8/gems/i2cssh-1.9.0/lib/i2cssh.rb:29:in `initialize'
from /Library/Ruby/Gems/1.8/gems/i2cssh-1.9.0/bin/i2cssh:192:in `new'
from /Library/Ruby/Gems/1.8/gems/i2cssh-1.9.0/bin/i2cssh:192
from /usr/bin/i2cssh:19:in `load'
from /usr/bin/i2cssh:19
For me, full-screen is quite important since otherwise any mouse movement during cssh init activates different panes from what the script expects and borks the whole thing :)
I would be nice to have a configuration file with a list of hosts that you connect to often. The list should be hierarchical:
Then i2cssh should accept the tags myservice, Another_service and even Another_service:Master. The interesting part is that Another_service should include Master and Slave machines in the previous example.
Config
was replaced by RbConfig
and so this doesn't build :(
I just installed i2cssh with Ruby 2.4.0 and I'm configuring my cluster in ~/.i2csshrc as follows:
version: 2
clusters:
c13:
hosts:
- dse01-use1-c13
- dse02-use1-c13
- dse03-use1-c13
- dse04-use1-c13
- dse05-use1-c13
- dse06-use1-c13
- dse07-use1-c13
- dse08-use1-c13
When I try to do i2cssh -c deploy@c13
I get the following stack trace:
dioxin:~ nynhex$ i2cssh -c deploy@c13
/Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/_aem/codecs.rb:236: warning: constant ::Fixnum is deprecated
/Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/_aem/codecs.rb:236: warning: constant ::Bignum is deprecated
/Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/_aem/codecs.rb:236: warning: constant ::Fixnum is deprecated
/Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/_aem/codecs.rb:236: warning: constant ::Bignum is deprecated
/Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:177:in `block in pack': Unknown Keyword: :terminal (IndexError)
from /Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:177:in `fetch'
from /Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:177:in `pack'
from /Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/_aem/send.rb:37:in `block in initialize'
from /Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/_aem/send.rb:37:in `each'
from /Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/_aem/send.rb:37:in `initialize'
from /Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/aem.rb:218:in `new'
from /Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/aem.rb:218:in `event'
from /Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:506:in `_send_command'
from /Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:642:in `method_missing'
from /Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/i2cssh-1.16.0/lib/i2cssh.rb:19:in `initialize'
from /Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/i2cssh-1.16.0/bin/i2cssh:298:in `new'
from /Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/i2cssh-1.16.0/bin/i2cssh:298:in `<top (required)>'
from /Users/nynhex/.rbenv/versions/2.4.0/bin/i2cssh:22:in `load'
from /Users/nynhex/.rbenv/versions/2.4.0/bin/i2cssh:22:in `<main>'
I'm sorry if this is not configured correctly or I'm doing something wrong, but would really like to be able to login to a cluster at once and am unsure as to what's going wrong.
Hi,
Is it possible to not show the unused window when the cluster has an 'odd' number? I don't care if it creates a non symmetrical set.
Thanks.
I am having an issue with i2cssh interpretting the cluster file (.i2csshrc). Here is my .i2csshrc file:
---
clusters:
servers-a:
- server01
- server02
servers-b:
- server03
- server04
Here's the error I get:
/usr/local/Cellar/ruby/1.9.2-p290/lib/ruby/1.9.1/syck.rb:135:in `load': syntax error on line 3, col 3: ` - server01' (ArgumentError)
from /usr/local/Cellar/ruby/1.9.2-p290/lib/ruby/1.9.1/syck.rb:135:in `load'
from /usr/local/Cellar/ruby/1.9.2-p290/lib/ruby/gems/1.9.1/gems/i2cssh-1.2.3/bin/i2cssh:49:in `block (2 levels) in <top (required)>'
from /usr/local/Cellar/ruby/1.9.2-p290/lib/ruby/1.9.1/optparse.rb:1308:in `call'
from /usr/local/Cellar/ruby/1.9.2-p290/lib/ruby/1.9.1/optparse.rb:1308:in `block in parse_in_order'
from /usr/local/Cellar/ruby/1.9.2-p290/lib/ruby/1.9.1/optparse.rb:1264:in `catch'
from /usr/local/Cellar/ruby/1.9.2-p290/lib/ruby/1.9.1/optparse.rb:1264:in `parse_in_order'
from /usr/local/Cellar/ruby/1.9.2-p290/lib/ruby/1.9.1/optparse.rb:1258:in `order!'
from /usr/local/Cellar/ruby/1.9.2-p290/lib/ruby/1.9.1/optparse.rb:1349:in `permute!'
from /usr/local/Cellar/ruby/1.9.2-p290/lib/ruby/1.9.1/optparse.rb:1370:in `parse!'
from /usr/local/Cellar/ruby/1.9.2-p290/lib/ruby/gems/1.9.1/gems/i2cssh-1.2.3/bin/i2cssh:64:in `<top (required)>'
from /usr/local/Cellar/ruby/1.9.2-p290/bin/i2cssh:19:in `load'
from /usr/local/Cellar/ruby/1.9.2-p290/bin/i2cssh:19:in `<main>'
Was wondering if there is a fix, or if I'm just got the syntax wrong for the cluster file.
Hi, with newer version of i2cssh, if i launch a cluster of 6 machines, the pane split is broken, if for example i set to use 3 columns, i creates them, uses the 3 columns, but the rest of the other 3 servers are spaunes in row mode on column # 1.
If i use 3 rows, the same, it creates 3 rows, but the other 3 servers are spawned on row # 1.
using different server amounts, is always broken.
could this be fixed ?
Using -2, --iterm2 or -i iTerm2 gives the same error:
Alejandros-MBP:~ alejandrito$ i2cssh -2 -m user1@host1,user2@host2 -m user3@host3 user4@host4 user5@host5
**/Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/_aem/findapp.rb:30:in rescue in _find_app': Application "[\"iTerm.app\"]" not found. (FindApp::ApplicationNotFoundError)** from /Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/_aem/findapp.rb:25:in
_find_app'
from /Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/_aem/findapp.rb:55:inrescue in by_name' from /Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/_aem/findapp.rb:49:in
by_name'
from /Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:855:inby_name' from /Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:932:in
by_name'
from /Library/Ruby/Gems/2.0.0/gems/i2cssh-2.2.0/lib/i2cssh.rb:13:ininitialize' from /Library/Ruby/Gems/2.0.0/gems/i2cssh-2.2.0/bin/i2cssh:298:in
new'
from /Library/Ruby/Gems/2.0.0/gems/i2cssh-2.2.0/bin/i2cssh:298:in<top (required)>' from /usr/local/bin/i2cssh:23:in
load'
from /usr/local/bin/i2cssh:23:in`
i2cssh v.2.2.0
iterm2 v.3.0.10
I would like my sessions to stack vertically instead of next to each other. I assume this can be accomplished with the -d (--direction) option or the -R (--rows) option. I'm getting the following error in both cases.
i2cssh --direction=row rprqa-app1 rprqa-app2
/Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:542:in `_send_command': CommandError (Appscript::CommandError)
OSERROR: -1719
MESSAGE: Access for assistive devices is disabled.
OFFENDING OBJECT: app("/System/Library/CoreServices/System Events.app").processes["iTerm2"].menu_bars[1]
COMMAND: app("/System/Library/CoreServices/System Events.app").processes["iTerm2"].menu_bars[1].menu_bar_items["Window"].menus["Window"].menu_items["Select Split Pane"].menus["Select Split Pane"].menu_items["Select Pane Above"].click()
from /Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:642:in `method_missing'
from /Library/Ruby/Gems/2.0.0/gems/i2cssh-2.2.0/lib/i2cssh.rb:103:in `block (2 levels) in split_session'
from /Library/Ruby/Gems/2.0.0/gems/i2cssh-2.2.0/lib/i2cssh.rb:102:in `upto'
from /Library/Ruby/Gems/2.0.0/gems/i2cssh-2.2.0/lib/i2cssh.rb:102:in `block in split_session'
from /Library/Ruby/Gems/2.0.0/gems/i2cssh-2.2.0/lib/i2cssh.rb:101:in `upto'
from /Library/Ruby/Gems/2.0.0/gems/i2cssh-2.2.0/lib/i2cssh.rb:101:in `split_session'
from /Library/Ruby/Gems/2.0.0/gems/i2cssh-2.2.0/lib/i2cssh.rb:26:in `initialize'
from /Library/Ruby/Gems/2.0.0/gems/i2cssh-2.2.0/bin/i2cssh:298:in `new'
from /Library/Ruby/Gems/2.0.0/gems/i2cssh-2.2.0/bin/i2cssh:298:in `<top (required)>'
from /usr/bin/i2cssh:23:in `load'
from /usr/bin/i2cssh:23:in `<main>'
Hello,
when I run
i2cssh feux
I get my 4 tabs with 4 different names "lacoste@agni", "lacoste@loki", "lacoste@hephaistos" and "lacoste@vulcain"
But when I run
i2cssh root@feux
I get 1 tab name "Shell (bash) and 3 tabs with the same name : "lacoste@cronos" where wronos is my localhost. It's not a big issue but if it is easy to do it would be great if the names where "root@machine_name[1-4]".
Thanks,
XL.
so iTerm2 has fantastic tmux support and I am trying to combine i2cssh and tmux but it is not happening. I can open my tmux session and try to execute: i2cssh -p tmux -c someservers but no matter what I cannot get it to open the windows in my existing session and thus actually open tmux windows rather than normal windows. Any suggestions?
Is it possible to use another SSH client or wrapper other than the native SSH client? I found a script that allows me to carry all of my local aliases to whatever hosts I shell into, I would like to use this along with i2cssh but don't see a way other than symlinking /usr/local/bin/ssh to the script, which I can't do since this is a shared workstation.
When completed with a run, I have to type exit once on the host, and twice in the opened sessions themselves due to the profile set commands. I would propose a simple change appended to line 172 on lib/i2cssh.rb
Original:
@term.sessions[@session_index + i].write :text => "unset HISTFILE && echo -e \"\\033]50;SetProfile=#{@profile}\\a\" && #{@ssh_prefix} #{send_env} #{server}"
Proposed:
@term.sessions[@session_index + i].write :text => "unset HISTFILE && echo -e \"\\033]50;SetProfile=#{@profile}\\a\" && #{@ssh_prefix} #{send_env} #{server} && exit"
It would be awesome to be able to get a list of hosts from an external command instead of specify specific hosts in the rc or using the -m
Something like
clusters:
cluster_a:
hosts_by_command: /bin/find_hosts ...
I get the following error when trying to spawn i2cssh:
Unknown property, element or command: 'desktop'
The full trace is:
ddecker$ i2cssh -l ddecker -m "es-tw01.emcent.scn.securustech.net es-tw02.emcent.scn.securustech.net" -F
/Library/Ruby/Gems/1.8/gems/rb-appscript-0.6.1/lib/appscript.rb:676:in `method_missing': Unknown property, element or command: 'desktop' (RuntimeError)
from /Library/Ruby/Gems/1.8/gems/i2cssh-1.9.0/lib/i2cssh.rb:37:in `maximize'
from /Library/Ruby/Gems/1.8/gems/i2cssh-1.9.0/lib/i2cssh.rb:29:in `initialize'
from /Library/Ruby/Gems/1.8/gems/i2cssh-1.9.0/bin/i2cssh:192:in `new'
from /Library/Ruby/Gems/1.8/gems/i2cssh-1.9.0/bin/i2cssh:192
from /usr/bin/i2cssh:19:in `load'
from /usr/bin/i2cssh:19
My Ruby Version:
ddecker$ ruby -v
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]
If there is no ~/.i2csshrc, then i2cssh just doesn't work, with a stacktrace instead of an error message:
$ i2cssh root@HOSTNAME1 root@HOSTNAME2
/Library/Ruby/Gems/1.8/gems/i2cssh-1.8.0/lib/i2cssh.rb:62:in split_session': undefined method
[]' for nil:NilClass (NoMethodError)
from /Library/Ruby/Gems/1.8/gems/i2cssh-1.8.0/lib/i2cssh.rb:25:in initialize' from /Library/Ruby/Gems/1.8/gems/i2cssh-1.8.0/bin/i2cssh:191:in
new'
from /Library/Ruby/Gems/1.8/gems/i2cssh-1.8.0/bin/i2cssh:191
from /usr/bin/i2cssh:23:in `load'
from /usr/bin/i2cssh:23
Hello,
There's a discussion here about the rb-appscript gem problems. In that thread, there's mention of a fork of the rb-appscript project that was done in pure ruby -- https://github.com/BrendanThompson/rb-scpt.
Could the rb-scpt
gem be used to restore compatibility with the most recent versions of ruby?
$ i2cssh -m host1.com,host2.com
/Library/Ruby/Gems/1.8/gems/rb-appscript-0.6.1/lib/appscript.rb:542:in `_send_command': CommandError (Appscript::CommandError)
OSERROR: -1719
MESSAGE: Access for assistive devices is disabled.
OFFENDING OBJECT: app("/System/Library/CoreServices/System Events.app").processes["iTerm"].menu_bars[1]
COMMAND: app("/System/Library/CoreServices/System Events.app").processes["iTerm"].menu_bars[1].menu_bar_items["Shell"].menus["Shell"].menu_items["Split Vertically with Current Profile"].click()
from /Library/Ruby/Gems/1.8/gems/rb-appscript-0.6.1/lib/appscript.rb:642:in `method_missing'
from /Library/Ruby/Gems/1.8/gems/i2cssh-1.9.0/lib/i2cssh.rb:74:in `split_session'
from /Library/Ruby/Gems/1.8/gems/i2cssh-1.9.0/lib/i2cssh.rb:73:in `upto'
from /Library/Ruby/Gems/1.8/gems/i2cssh-1.9.0/lib/i2cssh.rb:73:in `split_session'
from /Library/Ruby/Gems/1.8/gems/i2cssh-1.9.0/lib/i2cssh.rb:28:in `initialize'
from /Library/Ruby/Gems/1.8/gems/i2cssh-1.9.0/bin/i2cssh:192:in `new'
from /Library/Ruby/Gems/1.8/gems/i2cssh-1.9.0/bin/i2cssh:192
from /usr/bin/i2cssh:19:in `load'
from /usr/bin/i2cssh:19
$ ruby -v
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin11.0]
After longer multipane sessions, resizing panes all the time, is there the possibility to have them nicely arranged again, like with csshx Ctrl-A + r ?
PS: Good job, love the yaml style config setup, like in tmuxinator ;-)
Is it possible to define individual ssh ports to use for each server in the cluster? In csshX I just can do csshX username@host:port, which does not work with i2cssh.
Eventually aborting the application and throwing the following error :
lib/rb-scpt.rb:542:in _send_command': CommandError (Appscript::CommandError) OSERROR: -1719 MESSAGE: Access for assistive devices is disabled. OFFENDING OBJECT: app("/System/Library/CoreServices/System Events.app").processes["iTerm2"].menu_bars[1] COMMAND: app("/System/Library/CoreServices/System Events.app").processes["iTerm2"].menu_bars[1].menu_bar_items["Window"].menus["Window"].menu_items["Select Split Pane"].menus["Select Split Pane"].menu_items["Select Pane Left"].click() from /Users/carlo/.gem/ruby/2.0.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:642:in
method_missing'
from /Users/carlo/src/i2cssh/lib/i2cssh.rb:103:in block (2 levels) in split_session' from /Users/carlo/src/i2cssh/lib/i2cssh.rb:102:in
upto'
from /Users/carlo/src/i2cssh/lib/i2cssh.rb:102:in block in split_session' from /Users/carlo/src/i2cssh/lib/i2cssh.rb:101:in
upto'
from /Users/carlo/src/i2cssh/lib/i2cssh.rb:101:in split_session' from /Users/carlo/src/i2cssh/lib/i2cssh.rb:26:in
initialize'
from ./i2cssh:302:in new' from ./i2cssh:302:in
At least on Sierra, a system pop up will spawn asking for authorization to enable UI and showing iTerm in the list of applications that requested "UI" access.
Once that is enabled the following Applescript would return true :
tell application "System Events"
set GUIScriptingEnabled to (UI elements enabled)
return GUIScriptingEnabled
end tell
As an alternative, using instead Keys (as done in csshX) should allow for this to run without the need for "UI special access", which is restricted for Security reasons
Currently the default window size allows to open only 11 panes, thus 11 machines. The script breaks if you want to open more machines.
$ for i in 1 2 3 4 5 6 7 8 9 10 11 12 ; do echo localhost ; done | xargs i2cssh -C 1
/Library/Ruby/Gems/2.0.0/gems/rb-appscript-0.6.1/lib/appscript.rb:542:in `_send_command': CommandError (Appscript::CommandError)
OSERROR: -1719
MESSAGE: Can't get reference. Invalid index.
OFFENDING OBJECT: app("/Applications/iTerm.app").terminals[6].sessions[12]
COMMAND: app("/Applications/iTerm.app").terminals[6].sessions[12].write({:text=>"unset HISTFILE && echo -e \"\\033]50;SetProfile=Default\\a\" && ssh localhost"})
from /Library/Ruby/Gems/2.0.0/gems/rb-appscript-0.6.1/lib/appscript.rb:642:in `method_missing'
from /Library/Ruby/Gems/2.0.0/gems/i2cssh-1.9.0/lib/i2cssh.rb:111:in `block in start_ssh'
from /Library/Ruby/Gems/2.0.0/gems/i2cssh-1.9.0/lib/i2cssh.rb:95:in `upto'
from /Library/Ruby/Gems/2.0.0/gems/i2cssh-1.9.0/lib/i2cssh.rb:95:in `start_ssh'
from /Library/Ruby/Gems/2.0.0/gems/i2cssh-1.9.0/lib/i2cssh.rb:31:in `initialize'
from /Library/Ruby/Gems/2.0.0/gems/i2cssh-1.9.0/bin/i2cssh:192:in `new'
from /Library/Ruby/Gems/2.0.0/gems/i2cssh-1.9.0/bin/i2cssh:192:in `<top (required)>'
from /usr/bin/i2cssh:23:in `load'
from /usr/bin/i2cssh:23:in `<main>'
One solution would be to allow to resize the window on open, or dynamically resize the window, or always start in Fullscreen mode (which currently doesn't work in mountain lion it seems) and then go back. (Another option is to create a iterm profile that has a larger window size on start up, but that's less intuitive).
Comething like the following:
cluster1:
hosts:
My default shell is fish. i2cssh opens the first terminal with bash but the other ones seem to be fish in which &&
isn't valid syntax. Is there a way to force all the terminals to use bash?
unset HISTFILE && echo -e "\033]50;SetProfile=Default\a" && ssh HOSTNAME
this is really more of a question than an issue:
When I run i2cssh -c clustername, with 3 servers in my cluster, I'd like iTerm2 to show them vertically side by side, but it always shows the first one vertically (column 1), and then an additional 3 windows stacked in column 2. Here's a screenshot.
http://cl.ly/0e1e3C1M2W1q1h310I0p
I always just drag the windows into place and then close the fourth (empty) window. I imagine this is probably a setting in iTerm2, but I've never been able to track it down. Anyone have a guess if there is a way to tweak this?
Sorry for asking what's probably the most trivial question.
How can I broadcast command? This is the i2cssh command I do:
i2cssh -l myself hostA hostB hostC
When trying to use shell expansion in the FQDN, i2cssh ignores the zero padding when counting through the digits, even if it's specified.
server0{1..9).domain.com will result in connections to server01 to server09 respectively.
server{01..09}.domain.com will result in connections to server1 to server9 respectively, same follows for server{1..9}.domain.com
When I'm trying to shell into 10+ servers this creates an issue where I have to specify server0{1..9}.domain.com server{10..20}.domain.com otherwise the first 9 connections will fail if I did server{1..20}.domain.com.
This isn't an issue with bash because a quick test of echo {01..05} prints 01 02 03 04 05
I can't even tell what version I'm using since there is no form of the version flag apparently, but I cloned the repo only about 2 months ago.
Is there a way to pass SSH arguments similar to how they are passed in csshX? For example I'd like to be able to pass a pem file, e.g.
ssh -i mypem.pem user@host
My config setting is following:
$ cat .i2csshrc
---
version: 2
login: root
rows: 3
clusters:
my:
login: root
hosts:
- host1
- host2
...
- host7
Screenshot: http://cl.ly/image/3i193r3t2s3N
i2cssh my
, it ignores the login parameter - I am required to call i2cssh root@my
After a fresh install of i2cssh I get the following error:
$ i2cssh -c picocluster
/Users/govindaf/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:676:in `rescue in method_missing': Unknown property, element or command: 'create_window_with_profile' (RuntimeError)
from /Users/govindaf/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:646:in `method_missing'
from /Users/govindaf/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/i2cssh-2.0.0/lib/i2cssh.rb:20:in `initialize'
from /Users/govindaf/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/i2cssh-2.0.0/bin/i2cssh:298:in `new'
from /Users/govindaf/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/i2cssh-2.0.0/bin/i2cssh:298:in `<top (required)>'
from /Users/govindaf/.rbenv/versions/2.3.0/bin/i2cssh:22:in `load'
from /Users/govindaf/.rbenv/versions/2.3.0/bin/i2cssh:22:in `<main>'
I have the following version of i2cssh:
$ gem list i2cssh
*** LOCAL GEMS ***
i2cssh (2.0.0)
Ruby version: 2.3.0 (2015-12-25 patchlevel 0) [x86_64-darwin15]
iTerm: 2.1.4
Any hints how to fix this?
Hi,
I've been using csshX for terminal.app, but recently found i2cssh for iTerm2. One thing that I'm missing from i2cssh is the ability to set a port. e.g ssh -p or csshX :port.
I thought about attempting this myself, may have a go at it, but I thought I would submit an RFE as well. :)
Thanks for your hard work and effort.
/Bobby
Hello,
After upgrading to Iterm2 3.0 and I2cssh 2.0 the fullscreen options seems to be broken.
I have tried both options
i2cssh --fullscreen -nb -Xp=9090 Servers
or
i2cssh -F -nb -Xp=9090 Servers
We did a workaround on this just by creating a new Iterm2 profile and set the "Window" -> "Style" mode to Fullscreen and added the profile information to .i2csshrc
BTW Create product using it everyday ;)
Please add the functionality to group clusters in the .i2csshrc config.
Example:
---
version: 2
clusters:
clusterA:
hosts:
- server1
- server2
- server3
clusterB:
hosts:
- server4
- server5
- server6
clusterC:
hosts:
- clusterA
- clusterB
we have a similar functionality in csshx which was patched (brockgr/csshx#28). Use this we can replace ssh with custom library or a wrapper and achieve things like a expect scripts to automate server login.
Hello,
The latest iTerm releases are breaking i2cssh due to changing the way applescript is being supported and defined. New documentation can be found: https://www.iterm2.com/applescript.html. Should make the process of splitting/etc a whole lot simpler
Hi,
When I use "--clusters cluster1,cluster2,cluster3", only 3 hosts are being connected. In the other host tabs, it says "UNUSED".
Siva
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.