split multiple panes and ssh into server, run command, launch logs
up vote
0
down vote
favorite
I am running Ubuntu 18.04.1 and am trying to achieve the following.
I open my terminal and boot up tmux. I then run my bash script to split the window into 4 different panes. i then select each individual pane and ssh into a server, cd into a directory, launch a program, then tail the logs for said program.
Here's an example of what my bash script looks like.
tmux rename-window 'Logs';
tmux split-window -h;
tmux split-window -v ;
tmux select-pane -t 0;
tmux split-window -v ;
tmux select-pane -t 0 ;
tmux send-keys 'ssh user@server.com' enter ;
tmux send-keys 'p@sw0rd' enter ;
tmux send-keys 'cd dir/' enter ;
tmux send-keys './program/' enter ;
tmux send-keys 'tail -f logs/program.log' enter ;
again, i do this for each pane. When the script ends. The panes are successfully split and all 4 panes show the following.
bashFolder:$ ./tmuxBash (*this line is only shown on the original pane*)
ssh user@server.com
p@sw0rd
cd dir/
tail -f logs/program.log
me@laptopname:~home/bashFolder$ ssh user@server.com
user@server.com's password:
then all 4 panes are still expecting the password i tried to send after the initial ssh call.
This bash was working on a windows machine running linux through a VM (vagrant). I am not sure if I broke the script before I moved onto a linux box.
I appreciate any help, and my apologies for the format, this is my first post.
ubuntu ssh tmux
New contributor
add a comment |
up vote
0
down vote
favorite
I am running Ubuntu 18.04.1 and am trying to achieve the following.
I open my terminal and boot up tmux. I then run my bash script to split the window into 4 different panes. i then select each individual pane and ssh into a server, cd into a directory, launch a program, then tail the logs for said program.
Here's an example of what my bash script looks like.
tmux rename-window 'Logs';
tmux split-window -h;
tmux split-window -v ;
tmux select-pane -t 0;
tmux split-window -v ;
tmux select-pane -t 0 ;
tmux send-keys 'ssh user@server.com' enter ;
tmux send-keys 'p@sw0rd' enter ;
tmux send-keys 'cd dir/' enter ;
tmux send-keys './program/' enter ;
tmux send-keys 'tail -f logs/program.log' enter ;
again, i do this for each pane. When the script ends. The panes are successfully split and all 4 panes show the following.
bashFolder:$ ./tmuxBash (*this line is only shown on the original pane*)
ssh user@server.com
p@sw0rd
cd dir/
tail -f logs/program.log
me@laptopname:~home/bashFolder$ ssh user@server.com
user@server.com's password:
then all 4 panes are still expecting the password i tried to send after the initial ssh call.
This bash was working on a windows machine running linux through a VM (vagrant). I am not sure if I broke the script before I moved onto a linux box.
I appreciate any help, and my apologies for the format, this is my first post.
ubuntu ssh tmux
New contributor
You probably need to wait between sending thessh
command, before sending the password, as ssh will flush the input at the start so if you "type-ahead" it will be lost. Trysleep 5
or similar after the tmux ... ssh line.
– meuh
Nov 13 at 18:07
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am running Ubuntu 18.04.1 and am trying to achieve the following.
I open my terminal and boot up tmux. I then run my bash script to split the window into 4 different panes. i then select each individual pane and ssh into a server, cd into a directory, launch a program, then tail the logs for said program.
Here's an example of what my bash script looks like.
tmux rename-window 'Logs';
tmux split-window -h;
tmux split-window -v ;
tmux select-pane -t 0;
tmux split-window -v ;
tmux select-pane -t 0 ;
tmux send-keys 'ssh user@server.com' enter ;
tmux send-keys 'p@sw0rd' enter ;
tmux send-keys 'cd dir/' enter ;
tmux send-keys './program/' enter ;
tmux send-keys 'tail -f logs/program.log' enter ;
again, i do this for each pane. When the script ends. The panes are successfully split and all 4 panes show the following.
bashFolder:$ ./tmuxBash (*this line is only shown on the original pane*)
ssh user@server.com
p@sw0rd
cd dir/
tail -f logs/program.log
me@laptopname:~home/bashFolder$ ssh user@server.com
user@server.com's password:
then all 4 panes are still expecting the password i tried to send after the initial ssh call.
This bash was working on a windows machine running linux through a VM (vagrant). I am not sure if I broke the script before I moved onto a linux box.
I appreciate any help, and my apologies for the format, this is my first post.
ubuntu ssh tmux
New contributor
I am running Ubuntu 18.04.1 and am trying to achieve the following.
I open my terminal and boot up tmux. I then run my bash script to split the window into 4 different panes. i then select each individual pane and ssh into a server, cd into a directory, launch a program, then tail the logs for said program.
Here's an example of what my bash script looks like.
tmux rename-window 'Logs';
tmux split-window -h;
tmux split-window -v ;
tmux select-pane -t 0;
tmux split-window -v ;
tmux select-pane -t 0 ;
tmux send-keys 'ssh user@server.com' enter ;
tmux send-keys 'p@sw0rd' enter ;
tmux send-keys 'cd dir/' enter ;
tmux send-keys './program/' enter ;
tmux send-keys 'tail -f logs/program.log' enter ;
again, i do this for each pane. When the script ends. The panes are successfully split and all 4 panes show the following.
bashFolder:$ ./tmuxBash (*this line is only shown on the original pane*)
ssh user@server.com
p@sw0rd
cd dir/
tail -f logs/program.log
me@laptopname:~home/bashFolder$ ssh user@server.com
user@server.com's password:
then all 4 panes are still expecting the password i tried to send after the initial ssh call.
This bash was working on a windows machine running linux through a VM (vagrant). I am not sure if I broke the script before I moved onto a linux box.
I appreciate any help, and my apologies for the format, this is my first post.
ubuntu ssh tmux
ubuntu ssh tmux
New contributor
New contributor
edited Nov 13 at 17:59
Mr Shunz
1,6301516
1,6301516
New contributor
asked Nov 13 at 16:47
Deuces
11
11
New contributor
New contributor
You probably need to wait between sending thessh
command, before sending the password, as ssh will flush the input at the start so if you "type-ahead" it will be lost. Trysleep 5
or similar after the tmux ... ssh line.
– meuh
Nov 13 at 18:07
add a comment |
You probably need to wait between sending thessh
command, before sending the password, as ssh will flush the input at the start so if you "type-ahead" it will be lost. Trysleep 5
or similar after the tmux ... ssh line.
– meuh
Nov 13 at 18:07
You probably need to wait between sending the
ssh
command, before sending the password, as ssh will flush the input at the start so if you "type-ahead" it will be lost. Try sleep 5
or similar after the tmux ... ssh line.– meuh
Nov 13 at 18:07
You probably need to wait between sending the
ssh
command, before sending the password, as ssh will flush the input at the start so if you "type-ahead" it will be lost. Try sleep 5
or similar after the tmux ... ssh line.– meuh
Nov 13 at 18:07
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Deuces is a new contributor. Be nice, and check out our Code of Conduct.
Deuces is a new contributor. Be nice, and check out our Code of Conduct.
Deuces is a new contributor. Be nice, and check out our Code of Conduct.
Deuces is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1375082%2fsplit-multiple-panes-and-ssh-into-server-run-command-launch-logs%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You probably need to wait between sending the
ssh
command, before sending the password, as ssh will flush the input at the start so if you "type-ahead" it will be lost. Trysleep 5
or similar after the tmux ... ssh line.– meuh
Nov 13 at 18:07