ssh connection refused on Raspberry Pi [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
The community reviewed whether to reopen this question last year and left it closed:
Original close reason(s) were not resolved
Improve this question
I realize this question has already been asked in some different ways, however it doesn't seem like any of the ways I've come across have worked to fix this problem, so here it goes:
I'm trying to connect to my raspberry pi 3 raspbian setup via ssh on my laptop, but although I have the correct ip address, I keep getting the error:
ssh: connect to host xxx.xxx.xx.x port 22: connection refused.
This is unusual because when I try to ping that address, it works fine. Is there anything I can try to figure out what's wrong?
Also keep in mind I am relatively inexperienced with bash in linux, so inclusion of any specific commands with a description of what they do would be greatly appreciated.

Apparently, the SSH server on Raspbian is now disabled by default. If there is no server listening for connections, it will not accept them. You can manually enable the SSH server according to this raspberrypi.org tutorial :
As of the November 2016 release, Raspbian has the SSH server disabled by default.
There are now multiple ways to enable it. Choose one:
From the desktop
Launch Raspberry Pi Configuration from the Preferences menu
Navigate to the Interfaces tab
Select Enabled next to SSH
Click OK
From the terminal with raspi-config
Enter sudo raspi-config in a terminal window
Select Interfacing Options
Navigate to and select SSH
Choose Yes
Select Ok
Choose Finish
Start the SSH service with systemctl
sudo systemctl enable ssh
sudo systemctl start ssh
On a headless Raspberry Pi
For headless setup, SSH can be enabled by placing a file named ssh, without any extension, onto the boot partition of the SD card. When the Pi boots, it looks for the ssh file. If it is found, SSH is enabled, and the file is deleted. The content of the file does not matter: it could contain text, or nothing at all.

I think pi has ssh server enabled by default. Mine have always worked out of the box. Depends which operating system version maybe.
Most of the time when it fails for me it is because the ip address has been changed. Perhaps you are pinging something else now? Also sometimes they just refuse to connect and need a restart.

Related

Windows 10 to Centos7 Remote Desktop [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
My desktop computer is running Windows 10. I have created a virtual computer using Oracle VM Virtual Box that runs Centos7. In my Virtual Box settings I have changed the network adapter to Bridged Adapter. Everything starts correctly when the vm comes up. I then installed xrdp and tigervnc-server through epel. I have both xrdp and tigervnc services running. However when I try to remote desktop from Windows 10 to my virtual box, it can not connect. I can open a cmd window on Windows 10 and ping my ip address. The only thing that sticks out to me is that when I tried to enable the xrdp service, it states that it is not a native service. It still starts and attaches to port 3390. I changed this from 3389 after reading some tickets on stackoverflow.
xrdp.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig xrdp on
Is this the firewall biting me? What did I miss?
TIA
Ok, so it was the firewall that was biting me along with VM Virtual Box. In order to do remote desktop to a vm in Virtual Box, you must download an install VM Virtual Box extension pack. That will allow you to enable rdp under the display tab in settings. I also had to add the following to the CentOs firewall
firewall-cmd --permanent --add-port 3389/tcp
firewall-cmd --permanent --add-port 3350/tcp
Finally, I had to make sure that my vncpasswd was set to the same value as my CentOs login password. Otherwise it would not allow me to log in.

Raspberry Pi - suddenly no SSH access [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
Today I've noticed I can't connect to my raspi anymore using SSH with "Connection refused" or "...actively refused". It's extremely strange as far as until now, for a long time there was no problem accessing it through SSH. My raspi is actually running on wifi, I can ping it, I can HTTP access it, all the services seem to be running (I've got a streaming server on, PHP, apache, mysql - everything ok). I also have several config scripts reachable by HTTP requests, which are working normally. I have created a new set of ssh keys using
sudo dpkg-reconfigure ssh-server
then disabled and enabled ssh again via raspi-config, but nothing seems to work. Strange thing I've also noticed, that overnight, my router appended another IP address to my pi for some reason (despite that my IP lease time is set to forever on my wifi router), but I have no clue how this could affect my SSH access (maybe someone has some idea...?).
Important thing of this case is, that even if I try to locally (hdmi, keyboard, mouse) execute
ssh pi#raspberrypi
I still get "connection refused on port 22", I have no firewall and no other security stuff enabled and my router is set to forward SSH.
Actually, I can only access my raspi locally, not via network. I'm completely stuck. Any ideas? Tks.
On some systems the package ssh-server is called openssh-server.
sudo apt-get purge openssh-server
uninstall with purge, and:
sudo apt-get install openssh-server
The purge is to remove config files that may be broke.

Can't access localhost in LAMP [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
First of all, I'm beginner at this, so don't be too harsh.
Yesterday, I wanted to make Linux Server. Installed LAMP, PhpMyAdmin. Man the websites IP static. I installed moodle on my website server. Then I closed VirtualBox and went to sleep.
Today when I runned my server and tried to access /phpmyadmin or (ipaddress)/moodle it says that webpage isn't available. Does this mean I have to do everything from the scratch again?
I'd appreciate any help.
I tried command sudo service apache2 start , but nothing changes.
Run this command in Terminal:
sudo service apache2 restart
OR
sudo restart apache2
Try the Answer on this Post
There are a lot of basic troubleshooting steps to take here.
You mentioned "localhost" in your question, but this doesn't sound like the local host; if you're connecting to your guest machine from the host machine then both machines will treat it as a networking connection (because it is networking). How that networking is configured will depend on your VirtualBox configuration.
Are you sure the virtual machine is running, the IP address is assigned, and networking is, well, working? Try pinging the virtual/guest machine from the host machine. After pausing and resuming, one of my Debian machines used to always pick up a DHCP address on the host-networking adapter despite being set to a static address in /etc/network/interfaces. Look at ifconfig to verify the IP address listed is what you expect.
Are you sure Apache is running? Try accessing it from within the guest machine on http://localhost -- by telnet to port 80, command-line tool, or full-on web browser.
Are other services working? Try to connect remotely to whatever you have running: SSH, FTP, IMAP, MySQL, NTP -- try to connect and see if the problem is the network or the service.

VNC4Server/vncserver – always use desktop number 1 after starting of the vnc server [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I am using vncserver on a Ubuntu 14.04.3 LTS server machine to connect remotely and perform administrative tasks. I do not automatically start VNC. I first connect over SSH and call "vncserver -geometry 1024x800 &" to start it.
However normally vncserver always created desktop 1. Only if I had forgotten about a already running desktop it used 2 or 3 for the second session. But as soon as I killed all processes it started clean at desktop 1 again.
Now since I did some changes in startup by running multiple sessions for testing at a time and also after I changed the hostname of the server it always keeps starting with desktop 2 meanwhile 3. While 1 and 2 is definitively not running. I also removed all logs in my vnc home dir of previous sessions.
Well I'm wondering why and out of what reason it keeps increasing the desktop number sometimes. Also I would like to get it back to desktop 1 and fix it somehow. So that I can easily save the server Ip (IP:1) in my Remote-Profile without the need of changing it from time to time because vnsserver starts from an higher number.
Any ideas why it won't take desktop 1 any more?
:(
Thanks
vncserver will take the first available port from 5901 and onwards. There can be a few reasons why this does not work, like the port already being taken for something else. Or that vncserver is actually still running. Check out the file specified as log file for a clue.
You can check whether there still are vncserver processes running with:
vncserver -list
Without more information it's difficult to answer your question to the fullest. The various vnc implementations also behaves differently.
You can try to force it to open on display :1 by specifying it on the command line
vncserver :1 -geometry 1024x800

Using WinSCP to grab a file through a tunnel [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
There's a file on a node I'm trying to grab with WinSCP. Normally to access the file through my Linux VM I use the commands
ssh -p 2200 -L 2020:py-01:22 foo#university.edu
and that builds a tunnel to where I want to go. Then I open a second terminal and say:
ssh -p 2020 foo#localhost
Which connects me to that tunnel and I can see the file I want to get at. So I'm trying to use WinSCP to do the similar process so I can see the file and then make my own copy of it but I'm falling short. Can someone help me plugin the above commands to WinSCP?
If you need to connect through a tunnel for an SSH terminal session, you need to connect through the tunnel with WinSCP for an SFTP session too, as the SFTP uses the SSH underneath. There's no difference.
To setup a connection through a tunnel in WinSCP:
first set up a session as if you were connecting directly, i.e. py-01
click the Advanced button to open the Advanced Site Settings dialog
there go to the Connection > Tunnel page
check Connect through SSH tunnel
in the Host name specify a host to tunnel through, i.e. university.edu
in the User name specify an account for the tunnel host
Note that tunnel port is autoselected, so you do not specify it (2200) anywhere.
For detais, see:
https://winscp.net/eng/docs/ui_login_tunnel
If you have an SSH tunnel setup already (using the first command from your question, if it is run on Windows using Cygwin), you can connect to the existing external tunnel with WinSCP:
the Host name localhost
the Port number 2200
You can also do it the other way around: Explicitly specify the Local tunnel port number in WinSCP, and reuse the WinSCP tunnel also for an SSH terminal client.
Generally, a tunnel is not required for WinSCP. You can connect to the remote Linux machine via standard ssh port 22.
However, if you still need the tunnel, there is a guide: http://winscp.net/eng/docs/ui_login_tunnel.

Resources