Personally if I connect to a server and I'm going to do some sensitive work. I often use screen to ensure my session persist. This also allows you to continue your work on connection lost.
Lead Data Engineer with 3+ years of comprehensive experience in Google Cloud Platform with an in-depth understanding of large-scale data, data warehouses, data modeling, data pipelines, and data strea
Using screen or similar terminal multiplexer tools like tmux is a great practice for maintaining persistent sessions, especially when working on a remote server or conducting sensitive work. These tools allow you to create multiple virtual terminal instances within a single session, providing the following benefits: Session Persistence: If your connection is lost or if you log out, your processes continue running within the screen or tmux session. Upon reconnecting to the server, you can resume your work right where you left off.
Multiple Windows/Tabs: screen or tmux enable you to create and manage multiple windows or tabs within the same terminal session. This helps organize different tasks or processes without cluttering the workspace.
Detach and Reattach: You can detach from a screen or tmux session without terminating the processes running within it. Later, you can reattach to the same session from another location or after reconnecting to the server.
Here are some basic commands for screen:
**
screen
**
(To create a new session or resume an existing one.) Detach from a screen session:
Press Ctrl + A, then D
(This detaches you from the session without terminating it.)
List existing screen sessions:
screen -ls
(This shows all available screen sessions.)
Reattach to a screen session:
screen -r [session_id]
(This reattaches you to a specific screen session.)
For tmux, similar concepts apply with different commands. For example:
Starting a tmux session:
tmux
Detach from a tmux session:
Press Ctrl + B, then D
List existing tmux sessions:
tmux ls
Reattach to a tmux session:
tmux attach-session -t [session_id]
Remember, while these tools provide session persistence, it's still essential to follow proper security practices. Ensure strong authentication methods, regularly update your software, and maintain secure access controls to protect sensitive data or operations.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Personally if I connect to a server and I'm going to do some sensitive work. I often use screen to ensure my session persist. This also allows you to continue your work on connection lost.
This seems interesting!! Thanks for sharing alternative.
Using screen or similar terminal multiplexer tools like tmux is a great practice for maintaining persistent sessions, especially when working on a remote server or conducting sensitive work. These tools allow you to create multiple virtual terminal instances within a single session, providing the following benefits:
Session Persistence: If your connection is lost or if you log out, your processes continue running within the screen or tmux session. Upon reconnecting to the server, you can resume your work right where you left off.
Multiple Windows/Tabs: screen or tmux enable you to create and manage multiple windows or tabs within the same terminal session. This helps organize different tasks or processes without cluttering the workspace.
Detach and Reattach: You can detach from a screen or tmux session without terminating the processes running within it. Later, you can reattach to the same session from another location or after reconnecting to the server.
Here are some basic commands for screen:
**
**
(To create a new session or resume an existing one.)
Detach from a screen session:
(This detaches you from the session without terminating it.)
List existing screen sessions:
(This shows all available screen sessions.)
Reattach to a screen session:
(This reattaches you to a specific screen session.)
For tmux, similar concepts apply with different commands. For example:
Starting a tmux session:
Detach from a tmux session:
List existing tmux sessions:
Reattach to a tmux session:
Remember, while these tools provide session persistence, it's still essential to follow proper security practices. Ensure strong authentication methods, regularly update your software, and maintain secure access controls to protect sensitive data or operations.