S
S
sudo rm -rf /2017-08-31 03:03:03
bash
sudo rm -rf /, 2017-08-31 03:03:03

How to detach ssh from terminal without killing port forwarding?

There is a server that you need to work with via VNC, which looks at localhost.
To connect, I first forward port 5901 via ssh.
ssh [email protected] -L 5901:localhost:5901
You need to work as root (yes!), but before that, log in as user, and only then do su -.
The result is something like: The bottom line is that ssh remains attached to the terminal, but I do not need it. How to decide?
ssh [email protected] -L 5901:localhost:5901 -t 'su -'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
chupasaurus, 2017-08-31
@chupasaurus

  1. screen if you want to do everything in one session
  2. Start a -fseparate ssh session with the parameter (after reading in the manual how it works) to forward the port

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question