Answer the question
In order to leave comments, you need to log in
Autostart ssh under screen, in Ubuntu in the background before user login?
Hello.
There is such a command that establishes an SSH tunnel:
/usr/bin/ssh -D LocalIP:1080 -i aws.pem [email protected] -p 443
It is necessary that the tunnel be started automatically before the user login, as a service.
I put the following in rc.local before exit 0:
/usr/bin/screen -d -m /usr/bin/ssh -D LocalIP:1080 -i aws.pem [email protected] -p 443
Permissions - 755.
And if I I just run this command in the console, ssh will be screened in the background.
But it does not work on reboot, screen -list says that there are no sessions.
Please help, I don't understand what I'm doing wrong.
Answer the question
In order to leave comments, you need to log in
sudo crontab -e -u your_username
@reboot /usr/bin/screen -d -m /usr/bin/ssh -D LocalIP:1080 -i aws.pem [email protected] -p 443
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question