raspbian ssh connection refused after having enabled it - raspbian

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.

Related

Where can I find a tutorial on setting up tun devices to use with ssh -w?

I have a remote machine (Linux) and a local laptop (MacOS), I would like to resolve network traffic to certain domains/IPs transparently via the local laptop in an effort to essentially share a VPN that's running on the laptop with the remote machine.
The network conditions of the laptop are unpredictable as it could be on public wifi, mobile tethering or my home network - so I cannot set up a VPN running on a static IP.
I wondered if I could forward UDP traffic over SSH via -R, host a wireguard server on the laptop and connect to it on the remote. Turns out that's not possible.
However, OpenSSH has the -w flag (docs) that allows the tunneling of any kind of IP traffic over SSH but requires setting up tun devices on both ends. I don't know exactly what that means or where to get started learning about it.
Googling tutorials on SSH tunnels turns up results for TCP port tunneling (-L and -R), but nothing on -w.
Can you point me in a direction where I can figure out how to do this and if this will even work for me?

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.

Can not connect to VM instance via 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?

SSH into linux after creating an access point with hostapd

I made a remote control vehicle with a Raspberry Pi, but i am linked to a wifi router. I decided to make the Pi itself some kind of router to connect directly to it. I downloaded and set up hostapd, set the own_ip_addr=127.0.0.1. When i ping 127.0.0.1, i get responses, but i can't ssh at that address.
Any help is welcome. If you have any idea other than hostapd, please tell me. I just want to control the Pi via wifi without a router.
127.0.0.1 is the local address, and not valid external to the Pi...
If you want to connect to the Pi externally, you must find the Pi's network IP.
You could find this by running ip addr show on the Pi, and taking note of the IP for the interface you are using.
Then just use that IP when you try SSHing.

Net.Sockets : PC Portnumber changes dynamically in LAN via (DLINK)router

Hi i am creating server/client application using .net.Sockets something like cybercafe software.
Im following this example on codeproject Simple Socket Chat Program
there is no problem i run it on local pc. But when i run the client in the other pc in network i got a problem.
says :
No connection could be made because the target machine actively refused it.
I tried to use netstat -a on cmd and i found out that the portnumbers of all the p.c on our network always changes.
Is there any way to do it without using portnumber and just hostname or ipaddress only.
I need help...
Thanks in Regards
First, the random port numbers under Local Address in netstat are done so that everything gets a unique local port.
Also, a port is necessary for sockets.
The problem you are having is most likely because the firewall where your server software is located is blocking that port. For Windows 7 (and presumably Vista), you can unblock the port by running WF.msc, going to Inbound Rules on the left, clicking New Rule on the right, and adding a new program or port rule. The rest of the steps should be self-explanatory.