Autostart ssh under screen'om, in Ubuntu in the background before the user logs in?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
3 views
Hi.


There is such a team, establishing SSH tunnel:


/usr/bin/ssh -D LocalIP:1080 -i aws.pem ubuntu@RemoteIP -p 443


You want the tunnel to start automatically before the user logs in as a service.


I put in the rc.local before exit 0 the following:


/usr/bin/screen -d-m /usr/bin/ssh -D LocalIP:1080 -i aws.pem ubuntu@RemoteIP -p 443


Rights 755.


And if I just run this command in the console, ssh in the background Krinitsa.


But when restarting does not work, screen -list says that sessions are not.


Help plz, I don't understand what I'm doing wrong.
by | 3 views

3 Answers

0 like 0 dislike
sudo crontab-e-u imaverycoolcowboy
\r
@reboot /usr/bin/screen -d-m /usr/bin/ssh -D LocalIP:1080 -i aws.pem ubuntu@RemoteIP -p 443
by
0 like 0 dislike
In principle, all can be easier — put autossh and all.
by
0 like 0 dislike
shove this team his .bash_profile in the root directory!
it sounds gross, but works :)
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked Apr 27, 2019 by kachi88
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
27,906 users