Can't access on server after used ufw and forgot to allow port 22 to SSH - ssh

I have used UFW on my server, and I forgot to allow port 22 to ssh. Now I can not access on the server. I using hosting by Linode. Please give me a solution, I can not find anything to open port 22, because I can not access it.
ssh: connect to host xxx.xxx.xxx.xxx port 22: Operation timed out

This really should be a support ticket on Linode.
What they would tell you though is to access your Linode "out-of-band" with the Linode Shell a.k.a. LiSH. THey have a Linode Doc.

Related

Gitlab change ssh port (ubuntu 22.04 LTS, gitlab-ce 15.8.1)

I'm running my own gitlab server on Oracle Cloud
and its Domain handled by Cloudflare
But my gitlab ssh cloning doesn't work at all.
(as far as I can remember, HTTP 413 curl 22 The requested URL returned error: 413)
(And It also happened port 22 network unreachable error)
I think other process hold 22 port, so I tried to change gitlab ssh port to other port.
Changed gitlab.rb (gitlab_shell_ssh_port to other)
Open Oracle Cloud VCN port,
Open Ubuntu Firewall(ufw allow and also tried iptables)
And Add other port on sshd (/etc/ssh/ssh_config)
disable cloudflare DNS Proxy to DNS only.
but It doesn't work and even port is inaccessible.
more than that nothing listen on that port.
what should I do more on this?

Getting connection timed out when I try to connect to my self-managed Gitlab instance

I just installed a Gitlab on my VPS (at gitlab.mydomain.com). Thing is I can connect to it through HTTPS but not through SSH, even if I add a generated SSH key from my VPS.
My firewall doesn't block connections (I set up my UFW to allow connections on port 22)
When doing systemctl status ssh after I try to connect to my Gitlab, I can read things like :
Failed password for root from x.x.x.x port xxxxx ssh2
Received disconnect from x.x.x.x port xxxxx:xx: [preauth]
fatal: Timeout before authentication for xx.xxx.xxx.xx port xxxxx
I'd like to find a solution or to know if somebody already faced this problem (and how did you solve it by the way !)
I also did try to connect from different connections (Wi-Fi, 5G, ethernet) and none of them did work.
I can give more details if needed.
Thanks by advance,
Thibault

Forward server HTTP traffic to handle in another device via SSH Tunnel

I'm developing some webhook required direct access public domain to internal machine, thinking use SSH tunnel to forward data, or got alternative solution?
Hosting server & development machine are in same network
192.168.1.2/24 (Hosting server)
2nd machine is virtual mapping using forticlient firewall without static or dynamic IP in visible in hosting server, so is 1 way initial communication right now.
In this case possible to setup SSH tunnel forward all traffic from 192.168.1.2:80 to handle in development machine port 8080?
How to ssh syntax look like?
Thanks.
This could be done by setting up an SSH tunnel to the remote machine:
ssh -L localhost:80:localhost:8080 development-system
Every request to port 80 on the hosting-server is now forwarded to port 8080 on the development-system.
Please note, that the port 80 on the hosting-server could only be used, when you start the SSH command as root. Also note that the port 80 is only accessible from the hosting-server. To access the port 80 on the hosting-server from everywhere use the following:
ssh -L 80:localhost:8080 development-system
Be sure that you want that.
A good introduction to the topic could be found at
https://www.ssh.com/ssh/tunneling/example
https://unix.stackexchange.com/questions/115897/whats-ssh-port-forwarding-and-whats-the-difference-between-ssh-local-and-remot

Connecting to Apache Server

After I have created my apache server, and installed LAMP, I have portforwarded port 80, and am able to reach the server on any browser using my external IP. When I go to connect to the server through ssh using my terminal on my MacBook, I can only connect to it using the servers inet (IPv4) IP address, and not the external IP address using port 80, for example, I can connect to it using: ssh root#192.168.1.204, but I cannot connect to it using: ssh -p 80 root#'external ip address'
the error I get is: ssh_exchange_identification: Connection closed by remote host
PLEASE IF ANYONE CAN HELP! I have been struggling with this for days.
Thanks
SSH is port 22, you can't use it to connect to port 80. If you added the port 80 portion to your first command as well, you should see the same error.

firewall has blocked ssh. any wayarounds?

I want to connect to remote amazon aws service(EC2 instance) , and I would like to be able to ssh to it from my laptop while using the campus provided network (which has cyberoam firewall). However, they have pretty much every port blocked and ssh won't work. Is there anything i can do? does ssh run through port 80? I don't really know what to do .
All it says is :
ssh_exchange_identification: read: Software caused connection abort
ssh works elsewhere.
You can set your SSH server to use port 80 (or 443 if 80 is used for a webserver). Just check the configuration file of your ssh server for more details!