LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to lock TMUX ? (https://www.linuxquestions.org/questions/linux-software-2/how-to-lock-tmux-4175735170/)

Xeratul 03-22-2024 09:24 AM

How to lock TMUX ?
 
Hello

ctrl b + X is to lock the tmux?

I am unsure if it works

Kind regards

Turbocapitalist 03-22-2024 09:27 AM

You can make tmux read-only but that is voluntary, being done by run-time options with the client. There are tricks to enforce that though.

Can you elaborate on what you are trying to do?

Xeratul 03-23-2024 03:30 AM

tmux ; ssh towhateverip top ; annd then I wanna get a lock of tmux

Turbocapitalist 03-23-2024 04:12 AM

Quote:

Originally Posted by Xeratul (Post 6491369)
tmux ; ssh towhateverip top ; annd then I wanna get a lock of tmux

If you want top to run once, then use the -n option.

Or if you want tmux to run read-only then you can make a new, read-only client session:

Code:

tmux \
        new-session -d -s Top \; \
        rename-window -t Top:0 Monitoring \; \
        split-window -t Top:Monitoring \; \
        send-keys -t Top:Monitoring.0 'ssh whateverip1 "top"' C-m \; \
        send-keys -t Top:Monitoring.1 'ssh whateverip2 "top"' C-m \; \
        attach-session -t Top -f read-only

Note that -t read-only status is on the honor system. The same account (or other account if access is shared) can launch a new client with normal read-write permissions.


All times are GMT -5. The time now is 01:45 AM.