tmux send "command"

19 views
Skip to first unread message

Erol KAHRAMAN

unread,
Aug 17, 2022, 3:30:08 AM8/17/22
to tmux-...@googlegroups.com
Hi,
I created a script which connect to my switches by sending password with sshpass.
tmux send "sshpass -p PASSWORD ssh USER@SWITCH_IP" C-m

It is working as i expected. However when the command is executed at the top of the pane, i am able to see my password clearly. At the pane;

sshpass -p MyPassword ssh USER@SWITCH_IP

Is it possible to hide or make invisible the command sended to the tmux.

Thx.

Nicholas Marriott

unread,
Aug 17, 2022, 3:34:26 AM8/17/22
to Erol KAHRAMAN, tmux-users
You could send "stty -echo" before and "stty echo" after. Or send "clear; tmux clear-history"  after.



--
You received this message because you are subscribed to the Google Groups "tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tmux-users+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/tmux-users/CAFcnfZa1jEco3tf3qRzHY_t2eOzUHW-7-T%2BE2x2tNdpKR6G-1Q%40mail.gmail.com.

Nicholas Marriott

unread,
Aug 17, 2022, 3:40:17 AM8/17/22
to Erol KAHRAMAN, tmux-users
Or do this:

tmux send "sshpass -p PASSWORD ssh USER@SWITCH_IP" C-m \; send -R \; clear-history

Or use sshpass -f instead may be nicer.


On Wed, 17 Aug 2022, 08:30 Erol KAHRAMAN, <erol.k...@gmail.com> wrote:
--

Erol KAHRAMAN

unread,
Aug 17, 2022, 12:52:15 PM8/17/22
to Nicholas Marriott, tmux-users
Thank you Nicholas.

I succeeded with "stty -echo" command.

tmux send "stty -echo" C-m
tmux send "sshpass -p PASSWORD ssh USER@SWITCH_IP" C-m

Nicholas Marriott <nicholas...@gmail.com>, 17 Ağu 2022 Çar, 10:40 tarihinde şunu yazdı:


--
Erol KAHRAMAN
System Network Administrator
Reply all
Reply to author
Forward
0 new messages