Can not connect to VM instance via SSH - ssh

Today I found out I can not connect to my VM instance via SSH anymore.
I have checked and even re-added firewall rule to open port 22, yet I see the port is closed. I have done nothing that I can recollect that could have ended up closing that port.
I have also tried logging in via serial port, but I have no login password for that (I always let google just log me in with key).
Can anyone help me?

Related

SSH connection refused on external network with the default username

I recently tried to configure port fowarding on my raspberry pi, to be able to connect through it from anywhere. So, I changed my box parameters to permit it.
It seems to work, as my raspberry pi is responding. But I still use the pi username, and it seems to cause the rejection of the connection. When I try to connect to my raspberry pi, the following message appears:
PS C:\Users\MyUser> ssh pi#xx.xx.xx.xx
You are trying to login with the default username.
For security reasons this can only be done from a local network or console.
pi#xx.xx.xx.xx's password:
Permission denied, please try again.
Of course, I can assure you that the password I enter is correct. When I'm connected to my local network, even if I'm using the ip adress of my box (the one with the ip forawrding) to connect to my raspberry pi, it works perfectly. But if I try from another network, this message appears.
I've been trying to search on internet how to solve this problem but couldn't find anything, event by trying to modify the sshd config.
Any clues to remove this behavior and allow me to connect to my raspberry pi, from a distant network, only with a port redirection (yeah I've heard about tunnelin, pitunnel, etc but that's not what I'm looking for) and without changing the username (Yes I'm aware that chaning it will allow me to ssh succesfully but that's not what I'm looking for) ? Thanks in advance.

My website running in Oracle Cloud is down, how can I repair it?

I have a website that is running in Oracle Cloud, the website now is down and I tried to access using SSH in Putty but it cannot be accessed I only see the terminal screen.
What should I do?
Could you please check if the instance is running or not. If the instance is running please check for the ingress/egress firewall rules at security list/NSG/OS firewall for connectivity to the instance. Make sure you are not connected to any VPN or any corporate network. Once you are able to connect to the instance check for the status of the service. It should be Active.
Could you please confirm, were you able to connect to the instance before? Since when you are facing this issue?
For your reference: connecting to your instance.

raspbian ssh connection refused after having enabled it

I used sudo raspi-config, went into the advanced options, enabled ssh and tried with and without rebooting after this step, I am still getting Network Error: Connection refused
when trying to establish a connection via PuTTY
EDIT: It seems like the device isn't even connected to the network, even though I use DLAN to get it connected directly to the broadband router, the same DLAN I use to connect my primary desktop.
Have you checked your firewall?
I know that this is an old question, but I run into this same problem today when connecting to raspberry with Putty. In my case, the problem was that I used wlan instead of ethernet cable, and hostname -i gave the wrong Ip address.
I then run ifconfig, and realized that there was different Ip address for wlan. With that Ip address, Putty and Filezilla connected right away to my raspberry.
Hope that this will help someone.

Start ssh in background on OpenWRT via ssh

Good morning,
I recently moved to the universities dormitory and they have a specific way how to enable the internet connection. They require me to connect to the network via Cable, set up a specific static IP and then enable the Internet connectivity by ssh'ing to a special IP with my own account and password. As long as this ssh session is open, the internet connection is active. If closed, then it is lost.
My setup right now is like this: I connected an OpenWRT-based TP-Link router (TP-Link TL-WR841N/ND v9) to the dormitory's network. My devices are connected to the router's wifi.
To get an internet connection, right now I am doing this:
connect to the router via ssh
connect to the internet via ssh on the router
So basically I am having two running ssh sessions. This is quite annoying as my laptop has to be on and running if I want to have an internet connection. My idea would be to keep the ssh session on the router running all the time. For this, however, I would need to keep the ssh session running in the background of the router.
Starting the second SSH with & skips the password entry. So I have to get it back to fg, enter the password and the process is back in the foreground. CTRL+Z appears to be not working on OpenWRT.
The only thing which could skip the password entry would be connecting with a key, but the server I am connecting to is not allowing that.
Anybody having other ideas?
You can do multiple things to solve this
Create a script(which will connect to internet) in router and schedule it in a cron job
If nohup/tmux is available in the router, execute the commands with them so that they keep alive when the ssh session is terminated.
So, looks like I solved the problem.
As nohup/tmux is not available on the router, I had to find an equivalent. Fortunately, screen is available for my router. With screen, you can start the ssh for the internet in a separate screen. When it's running, you can simply detach the screen and close the ssh to the router.
The ssh-connection for the internet will continue running in the background of the router.
The only drawback is that I have to reconnect manually, as soon as the router restarts.

Connection refused on new EC2 Instance putty

I've created an instance of a server on EC2 based on an AMI generated from an existing server. All goes well during the create, and I specify the same key for the new server as the old. However, when I try to connect to the new server via putty, I get a "connection refused" message. Also, I'm unable to ping to the public address, although I selected the "default" group which allows ICMP. The server status is "running". Any ideas why I can't connect?
Note that an nmap probe gives this output:
PORT STATE SERVICE
22/tcp closed ssh
80/tcp closed http
2144/tcp closed unknown
10000/tcp closed snet-sensor-mgmt
I'm pretty sure this means that ssh isn't running, although the port is open. Any idea why it would be running on the system I did the AMI from, but not on the one the AMI was generated from? Shouldn't all the same services be starting?
It did turn out to be a security group/permissions issue. The default security group looks open, but actually shuts everything down, per this post:
https://serverfault.com/questions/245916/why-cant-i-ssh-or-ping-my-brand-new-amazon-ec2-instance
as you are taking the existing AMI you have to delete all the old entries from authenticated file except new entry.
because while the coping the AMI old entries are still present in new instance so once you will delete it you may able to login into the instance.
One Reason i found is entry in WLAN in current working network i.e. of my office. you may have restrictions.try contacting network admin.
alternatively you can try for adding entry to inbound rule of your current ip address.