itermocil
itermocil copied to clipboard
SSH
Hey Tom, great app!
I'm trying to run my commands starting with an SSH into a remote box. then from there, change directories and eventually run a top or tail a log file.
so my YML file is something like this:
windows:
- name: Test
root: ~/
layout: even-horizontal
panes:
- commands:
- ssh username@host
- sudo su - someotheruser
- tail -f somefile
- commands:
- ssh username@host
- sudo su - someotheruser
- top
Though the 2nd and 3rd command execute on my shell before SSH'ing into the remote box. Now I understand why this would be tricky, though is there a way to do this?
I am trying to do same thing. I can't find other way to do this. If you are only tail
the file, you can try this:
ssh username@host tail -f somefile
That would be great if we could do it. I want to ssh into several servers and then attach to a tmux session on each. I tried both approaches above with no success.
Does this have a solution yet? I read about the applescript workaround in another issue, but is there an easier way to do it? @TomAnthony
I'm also running into this issue. I would like to be able to ssh into my vagrant box as part of my itermocil start up script using the command 'vagrant ssh', however it seems that the commands that follow the ssh call are run before the SSH is established.
This would be a great addition to what is already such a useful tool :)
- commands:
- vagrant ssh
- . venvs/myproject/bin/activate
- cd /vagrant/
Stumbled across this solution for queuing commands after another has completed.. which uses another package (thanks @TomAnthony) https://github.com/TomAnthony/itermocil/issues/3 However it still doesn't seem to work with SSH connections.
panes:
- commands:
- vagrant ssh; q -t
- q; . venvs/myproject/bin/activate
- q; cd /vagrant/
a not so elegant solution. You can pass a list of command to ssh
For tailing i prefer @duqcyxwd 's solution.. If i want to login as root in a remote machine i do
ssh -t <<machine ip>> "sudo -i"
It's possible with this command:
ssh -t [host] "[command 1] && [command 2]; bash"
I know this is extremely old, but I wanted to run a command and then to continue to interact on the remote server, and I found a solution here: https://serverfault.com/a/158091
To add interactivity, run bash -l
after your initial command. It worked for my use case