autossh | Longlive SSH sessions | SSH library
kandi X-RAY | autossh Summary
kandi X-RAY | autossh Summary
Longlive SSH sessions!
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of autossh
autossh Key Features
autossh Examples and Code Snippets
Community Discussions
Trending Discussions on autossh
QUESTION
I am trying to run an SSH command in a systemd service. Although I the user I set to run the command fedora
has permission to everything the command requires (verified by both running the command manually in a logged-in shell without failure and permission checks on the files), it still gives the error of permission denied.
ANSWER
Answered 2020-Oct-16 at 11:55It could be SELinux, the new ssh port has to be registered in selinux.
Firs check if the service work by disabling selinux temporarily, if it works add ssh port to selinux as follow.
QUESTION
I am struggling to build this baby Dockerfile:
...ANSWER
Answered 2020-Apr-02 at 14:34Your Docker DNS could be breaking index file resolution. Try using docker build --network=host
QUESTION
I have created file one which runs a flask server, starts the Alexa sample app and another is a cmdline command which runs port forwarding server.
which are:
led.py, sudo bash startsampleapp.sh, and the command is: autossh -M 0 -R 80:localhost:8000 serveo.net
So I want to run all these three from one file I tried using subprocess, Multiprocessing and os but didn't seem to work it doesn't go ahead of led.py. And this 3 should run simultaneously because to start Alexa I need to run Alexa sample app by this command: "sudo bash startsampleapp.sh" and when we ask Alexa to do something serveo.net will get the request and it will forward it to led.py(flask server).so Please help me regarding this.
I have tried creating a bash file like this:
...ANSWER
Answered 2019-Dec-04 at 12:41The solution I found was opening 3 terminal and running that 3 things respectively.
I create a bash file main.sh which contained:
QUESTION
I'm using autossh -M 20000 -fN -R 19999:localhost:22 -i mycert.pem ubuntu@myaws.hopto.org
to establish a reverse tunnel to my aws machine. Now, when I try to access the machine from aws
, I got the following:
ANSWER
Answered 2019-Aug-21 at 06:38I have been struggling with this for awhile too. My answer was probably pretty basic and a typical beginner mistake, and may not be your answer, but I will post this here just in case someone else is having trouble and this helps them:
The public key of the machine you are trying to reverse ssh from to needs to exist on the authorized_keys file on your local machine.
Reverse SSH connects to a local port, which is in reality your own local machine, so it will be looking for a public key on your local machines authorized_keys file that does not exist. It is easy to get confused with this because you are using "localhost" as the address, but just imagine it that you are opening a portal into a remote location at some random port, and then acting as that remote user to connect from that location to the port you made. When it connects to the port, it will still need ask for permission through the port to send commands down. Since it is a portal into your home, it will look there for the key. If there is no key at the other end of the port, it wont work.
ELI5 style:
You want another world to send you stuff but they can't because you are in a secret location, so you make a red port and a blue port into the other world.
You jump through red port, but the people at the other end don't know where blue port is, so you have to tell them where the blue port is. They attempt to go through the port but cant get in because you have not yet authorized them to come over and security isn't having it today.
So you have them make a key card there and you bring it back to your own world and tell your own security "this key card is good, let them in".
Now you can go back over again, and tell them to knock. This time the security sees that these are friends and they get let in.
So:
QUESTION
I would like to use autossh instead of the ssh command run by google cloud while doing
gcloud compute ssh --zone myzone --project myproject mymachine
What is the command line to replace it?
...ANSWER
Answered 2019-Aug-13 at 16:00Here is the two commands that allow you to use autossh:
QUESTION
I have a basic flask socket.io chat app that's built the same as this example https://github.com/miguelgrinberg/Flask-SocketIO-Chat
I can run the app with gunicorn mychat:app --worker-class eventlet -w 1 --bind 0.0.0.0:5000 --reload
and then autossh -M 0 -R myappname:80:localhost:5000 serveo.net
and hitting the appropriate serveo.net url.
I'm trying to deploy this on an AWS EC2 instance behind a loadbalancer with HTTPS. On the EC2 instance I installed nginx as here: https://flask-socketio.readthedocs.io/en/latest/#using-nginx-as-a-websocket-reverse-proxy (the single example, not the multiple nodes example).
When I go to the URL I defined from my loadbalancer target group, and i enter a chatroom, I see that in the Network tab of my browser, there are tons of rapid polling requests that keep giving a 200 then a 301. If I join the chatroom in another tab, the users are not able to send message to each other.
What is wrong with my configuration?
...ANSWER
Answered 2019-Feb-20 at 22:29After digging around, I figured it out. My host, example.com, points to a load balancer with a bunch of listener rules. I made it so that if path=/mychatapp/*, then forward to the ec2 instance running the app. This is fine, but socket.io was making calls with host=example.com so it was hitting example.com/socket.io/etcetcetc... I added another load balancer listener rule if path=/socket.io/*, then also forward it to the ec2 instance. This works out.
This solution is pretty hacky since it means I couldn't run a second socket.io app. A better answer would be to somehow change the default call from "/socket.io" to "/mychatapp/socket.io" so that I wouldn't require another listener rule. I tried a few ways to do this, but it didn't work. Since this is a small project, I will stick with this solution.
QUESTION
I seem to have a weird issue:
I want to restart a reverse ssh tunnel on boot, I've tried it with an init script (that works fine when executed as user) and with an added line in /etc/rc.d
but none of it works. What I get after boot is:
ANSWER
Answered 2018-Nov-10 at 07:47Replace ~/.ssh/etherwan.key
in your rc.d script with /home/ron/.ssh/etherwan.key
The '~' character is expanded to the user's home directory by the shell, but rc.d scripts are run as root.
QUESTION
We are trying to get autossh to connect to remote server at boot time in Ubuntu 16.04.2. So we use systemctl to do the job. The script is as following:
...ANSWER
Answered 2017-Apr-03 at 19:15Instead of After=network.target
, use After=network-online.target
.
More about systemd network targets are documented on the systemd wiki page.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install autossh
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page