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.
Related
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.
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'm trying to connect Winscp with virtual machine. I'm working on Windows,and this problem is killing me for 5 hours. Studied a lot of examples, but I can't find out what is the problem. I tried to connect with putty to, but connection is every time refused. Tried to connect with every protocol, but didn't help. I even can't install ssh into Ubuntu, because something is blocking but not firewall(failed to fetch us archive ubuntu com). Port forwarding too wasn't very helpful.
1st Adapter is NAT, and second host-only.
Problem is that I need to enter home directory, and add some files, so I'm trying to find the easiest way to do this.
I would really appreciate any help. Here is my ifconfig, ip a, and interfaces picture.
1
Thanks!
Use the following step to configure.
1- Run ipconfig /all on your windows machine and see which ip are assigned to your virtual adopters.
2- Assign the same range ip to your virtual machine. For example:
If on virtual adopter ip is: 192.168.130.1
Then assign ip to your vm as: 192.168.130.*
and set gateway to : 192.168.130.1
and restart the service network and check the reachability by pinging from both side.
3- If You able to ping then you will be able to use internate on your VM. Then install the ssh.
Now you will be able to use.
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
So I am learning Django and instead of trying to set everything up on Windows, I set up a Ubuntu 14.04 Server VM and set everything up there. I've set the Network mode to Bridged. I am able to SSH into the VM and everything works fine on that end. I followed this guide: https://github.com/makrandgupta/pyladies-django-workshop and was able to get through the installation process. I run the final command and the program tells me that the server is up and running. When I try to access the guest's IP from my browser on my host, I just get a Connection Refused Error. I had tried it with another linux installation and there I was able to access the website from the browser inside the guest but not from the host. I thought it would be an issue with the distro so switched to Ubuntu Server and having the same issue with it.
Any idea what I'm doing wrong?
If you are accessing the site from another server, then python manage.py runserver will not work. You could specify the actual ip of the server, or use 0.0.0.0.
python manage.py runserver 0.0.0.0:8000
See the question About IP 0.0.0.0 in Django for more info.
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.
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'm a complete begginer in Linux, especially in Linux for servers. I just installer Ubuntu in a server and now I'm trying to configure SSH for remote access.
I installed openssh-server and then did ufw allow 22.
Now when I do ssh username#XXX.XXX.X.XXX in another computer it says that the remote host identification was changed.
I did some research and found this tutorial, but I don't know if it is what I need.
I just want to configure the SSH access to the server.
Can anyone help me?
During SSH request the server presents its id to clien which the client stores along with the host name/IP of the server as known hosts.
When the ID(key) of the server changes(may be due to intallation of ssh server, ip address change, etc), the SSH request fails as the server ID stored in known_hosts is different from the one presented now. This is what has happened.
If you have not made any changes to the server and this happens beware it might indicate a man-in-middle attack where the attacker is trying to snoop you connection to server.
To fix this you need to remove a entry in known_hosts file.
ssh-keygen -R <hostname/IP>
If you are unsure about your client hostname you can just delete the known_hosts file using
rm ~/.ssh/known_hosts