60 likes | 71 Views
Sometimes you may need to share Linux Terminal Session with others. Here are the steps to do so using tmux and screen commands.<br>#linux #ubuntu <br><br>Visit https://fedingo.com/how-to-share-linux-terminal-session-with-others/
E N D
Screen Sharing Using Single Account - Using Screen Open terminal and run the following screen command to create a session named abc. $ screen -S abc Then open another terminal, on same or different machine, and run the following command to attach to that session. Please note, you need to login using the same account that was used to create the above session. $ screen -x abc
Screen Sharing Using Single Account - Using tmux You can also share session using tmux utility. Open terminal and run the following command to start the session abc using tmux. $ tmux new-session -s abc Open a new terminal on same of different machine, using the same user account and run the following command to attach to the above session. $ tmux attach-session -t abc
Screen Sharing using Different Accounts - Using tmux First of all, we need to set permissions on tmux socket so that both users can read & write to it. The two users need to be a part of the same user group. Open terminal and run the following command to create a new session named shared running on shareds socket. $ tmux -S /tmp/shareds new -s shared Then we use chgrp to add shareds socket to group named joint. Please note, other users who are present in this group will also be able to access the session. $ chgrp joint /tmp/shareds Open another terminal and run the following command to attach to the shared session. $ tmux -S /tmp/shareds attach -t shared
Screen Sharing using Different Accounts - Using Screen You need to set SUID to screen command and remove group write access from /var/run/screen. Then use screen’s ACL to grant permission to second user. Here is the command to set SUID and remove write access from /var/run/screen. $ sudo chmod u+s /usr/bin/screen $ sudo chmod 755 /var/run/screen Next, run the following commands to start a session named abc and add user user2 to the session. $ screen -S abc $ ^A:multiuser on $ ^A:acladd user2 The second user can attach to the first user’s session using the following command. $ screen -x user1/abc
Thank You Visit for details https://fedingo.com/how-to-share-linux-terminal-session-with-others/