Skip to main content
Sort out indented code blocks in list
Source Link
Kusalananda
  • 355.8k
  • 42
  • 735
  • 1.1k

Thanks topic. I solved for Ubuntu 24. This is my step-by-step explanation.

  1. Preparation

    Preparation

    sudo apt install htop nano tmux -y
    
  2. Make service to call tmux and start the application (in this example htop but it can be any user application).

    sudo nano /etc/systemd/system/myservice.service
    
    [Unit]
    Description=my tmux service
    After=multi-user.target # https://unix.stackexchange.com/questions/404667/systemd-service-what-is-multi-user-target
    
    [Service]
    User=q
    Group=q
    ExecStart=bash -c "tmux new-session -s q -d 'htop'"
    Type=forking
    
    [Install]
    WantedBy=multi-user.target
    
  3. Ask systemd to start our service at boot.

    sudo systemctl enable myservice.service
    
  4. Service will start after reboot. We should do reboot or start immediately.

    sudo systemctl start myservice
    
  5. You can connect long way

    ssh [email protected]
    tmux attach
    

    Or you can connect short way. Thanks topic

    ssh [email protected] -t tmux a
    
sudo apt install htop nano tmux -y
  1. Make service to call tmux and start the application (in this example htop but it can be any user application).
sudo nano /etc/systemd/system/myservice.service
[Unit]
Description=my tmux service
After=multi-user.target # https://unix.stackexchange.com/questions/404667/systemd-service-what-is-multi-user-target

[Service]
User=q
Group=q
ExecStart=bash -c "tmux new-session -s q -d 'htop'"
Type=forking

[Install]
WantedBy=multi-user.target
  1. Ask systemd to start our service at boot.
sudo systemctl enable myservice.service
  1. Service will start after reboot. We should do reboot or start immediately.
sudo systemctl start myservice
  1. You can connect long way
ssh [email protected]
tmux attach

Or you can connect short way. Thanks topic

ssh [email protected] -t tmux a

Thanks topic. I solved for Ubuntu 24. This is my step-by-step explanation.

  1. Preparation
sudo apt install htop nano tmux -y
  1. Make service to call tmux and start the application (in this example htop but it can be any user application).
sudo nano /etc/systemd/system/myservice.service
[Unit]
Description=my tmux service
After=multi-user.target # https://unix.stackexchange.com/questions/404667/systemd-service-what-is-multi-user-target

[Service]
User=q
Group=q
ExecStart=bash -c "tmux new-session -s q -d 'htop'"
Type=forking

[Install]
WantedBy=multi-user.target
  1. Ask systemd to start our service at boot.
sudo systemctl enable myservice.service
  1. Service will start after reboot. We should do reboot or start immediately.
sudo systemctl start myservice
  1. You can connect long way
ssh [email protected]
tmux attach

Or you can connect short way. Thanks topic

ssh [email protected] -t tmux a

Thanks topic. I solved for Ubuntu 24. This is my step-by-step explanation.

  1. Preparation

    sudo apt install htop nano tmux -y
    
  2. Make service to call tmux and start the application (in this example htop but it can be any user application).

    sudo nano /etc/systemd/system/myservice.service
    
    [Unit]
    Description=my tmux service
    After=multi-user.target # https://unix.stackexchange.com/questions/404667/systemd-service-what-is-multi-user-target
    
    [Service]
    User=q
    Group=q
    ExecStart=bash -c "tmux new-session -s q -d 'htop'"
    Type=forking
    
    [Install]
    WantedBy=multi-user.target
    
  3. Ask systemd to start our service at boot.

    sudo systemctl enable myservice.service
    
  4. Service will start after reboot. We should do reboot or start immediately.

    sudo systemctl start myservice
    
  5. You can connect long way

    ssh [email protected]
    tmux attach
    

    Or you can connect short way. Thanks topic

    ssh [email protected] -t tmux a
    
edited body
Source Link

Thanks topic. I solved for Ubuntu 24. This is my step-by-step explanation.

  1. Preparation
sudo apt install htop nano tmux -y
  1. Make service to call tmux and start the application (in this example htop but it can be any user application).
sudo nano /etc/systemd/system/myservice.service
[Unit]
Description=my tmux service
After=multi-user.target # https://unix.stackexchange.com/questions/404667/systemd-service-what-is-multi-user-target

[Service]
User=q
Group=q
ExecStart=bash -c "tmux new-session -s q -d 'htop'"
Type=forking

[Install]
WantedBy=multi-user.target
  1. Ask SystemDsystemd to start our service at boot.
sudo systemctl enable myservice.service
  1. Service will start after reboot. We should do reboot or start immediately.
sudo systemctl start myservice
  1. You can connect long way
ssh [email protected]
tmux attach

Or you can connect short way. Thanks topic

ssh [email protected] -t tmux a

Thanks topic. I solved for Ubuntu 24. This is my step-by-step explanation.

  1. Preparation
sudo apt install htop nano tmux -y
  1. Make service to call tmux and start the application (in this example htop but it can be any user application).
sudo nano /etc/systemd/system/myservice.service
[Unit]
Description=my tmux service
After=multi-user.target # https://unix.stackexchange.com/questions/404667/systemd-service-what-is-multi-user-target

[Service]
User=q
Group=q
ExecStart=bash -c "tmux new-session -s q -d 'htop'"
Type=forking

[Install]
WantedBy=multi-user.target
  1. Ask SystemD to start our service at boot.
sudo systemctl enable myservice.service
  1. Service will start after reboot. We should do reboot or start immediately.
sudo systemctl start myservice
  1. You can connect long way
ssh [email protected]
tmux attach

Or you can connect short way. Thanks topic

ssh [email protected] -t tmux a

Thanks topic. I solved for Ubuntu 24. This is my step-by-step explanation.

  1. Preparation
sudo apt install htop nano tmux -y
  1. Make service to call tmux and start the application (in this example htop but it can be any user application).
sudo nano /etc/systemd/system/myservice.service
[Unit]
Description=my tmux service
After=multi-user.target # https://unix.stackexchange.com/questions/404667/systemd-service-what-is-multi-user-target

[Service]
User=q
Group=q
ExecStart=bash -c "tmux new-session -s q -d 'htop'"
Type=forking

[Install]
WantedBy=multi-user.target
  1. Ask systemd to start our service at boot.
sudo systemctl enable myservice.service
  1. Service will start after reboot. We should do reboot or start immediately.
sudo systemctl start myservice
  1. You can connect long way
ssh [email protected]
tmux attach

Or you can connect short way. Thanks topic

ssh [email protected] -t tmux a
added 167 characters in body
Source Link

Thanks topic. I solved for Ubuntu 24. This is my step-by-step explanation.

  1. Preparation
sudo apt install htop nano tmux -y
  1. Make service to call tmux and start the application (in this example htop but it can be any user application).
sudo nano /etc/systemd/system/myservice.service
[Unit]
Description=my tmux service
After=multi-user.target # https://unix.stackexchange.com/questions/404667/systemd-service-what-is-multi-user-target

[Service]
User=q
Group=q
ExecStart=bash -c "tmux new-session -s q -d 'htop'"
Type=forking

[Install]
WantedBy=multi-user.target
  1. Ask SystemD to start our service at boot.
sudo systemctl enable myservice.service
  1. You can connect long wayService will start after reboot. We should do reboot or start immediately.
sudo systemctl start myservice
  1. You can connect long way
ssh [email protected]
tmux attach

Or you can connect short way. Thanks topic

ssh [email protected] -t tmux a

Thanks topic. I solved for Ubuntu 24. This is my step-by-step explanation.

  1. Preparation
sudo apt install htop nano tmux -y
  1. Make service to call tmux and start the application (in this example htop but it can be any user application).
sudo nano /etc/systemd/system/myservice.service
[Unit]
Description=my tmux service
After=multi-user.target # https://unix.stackexchange.com/questions/404667/systemd-service-what-is-multi-user-target

[Service]
User=q
Group=q
ExecStart=bash -c "tmux new-session -s q -d 'htop'"
Type=forking

[Install]
WantedBy=multi-user.target
sudo systemctl enable myservice.service
  1. You can connect long way
ssh [email protected]
tmux attach

Or you can connect short way. Thanks topic

ssh [email protected] -t tmux a

Thanks topic. I solved for Ubuntu 24. This is my step-by-step explanation.

  1. Preparation
sudo apt install htop nano tmux -y
  1. Make service to call tmux and start the application (in this example htop but it can be any user application).
sudo nano /etc/systemd/system/myservice.service
[Unit]
Description=my tmux service
After=multi-user.target # https://unix.stackexchange.com/questions/404667/systemd-service-what-is-multi-user-target

[Service]
User=q
Group=q
ExecStart=bash -c "tmux new-session -s q -d 'htop'"
Type=forking

[Install]
WantedBy=multi-user.target
  1. Ask SystemD to start our service at boot.
sudo systemctl enable myservice.service
  1. Service will start after reboot. We should do reboot or start immediately.
sudo systemctl start myservice
  1. You can connect long way
ssh [email protected]
tmux attach

Or you can connect short way. Thanks topic

ssh [email protected] -t tmux a
added 61 characters in body
Source Link
Loading
added 62 characters in body
Source Link
Loading
Source Link
Loading