Меню Рубрики

Mac os ssh connection refused

Question: Q: ssh fails with «Port 22: connection refused»

Hi there,
I’m trying to use ssh on my PowerBook G4 running OS 10.5. In particular, I’m trying to log into the PowerBook remotely using ssh from another machine. However, if I try to ssh into the PowerBook, I get an error saying «Port 22: Connection refused». I get this error even if I try to ssh into the IP of the PowerBook using the PowerBook itself. Is there something I have to do to turn on ssh in Leopard?

MacBook Pro, Mac OS X (10.5.2)

Posted on Oct 3, 2008 10:51 AM

System Preferences -> Sharing -> Remote Login

Also, are you trying to do this on the same local area network, or are you trying to do this across the internet.

If across the internet, you will need to make sure that your internet facing router is forwarding port 22 to your Powerbook.

Also make sure that your Mac OS X Firewall is allowing ssh remote logins: System Preferences -> Security -> Firewall. Of course if you have your Firewall turned off, this is not an issue.

If you continue have problems, the use the ssh -v, ssh -vv, and ssh -vvv option that will give you a great deal more diagnostic information.

Источник

Question: Q: SSH connection refused

Hello everyone. I’ve seen this topic posted around the web, but there seem to be no answers available. i’m wondering if anyone has solved it.

On 10.5.8, allowing remote network connections should be relatively straightforward.

System Preferences -> Sharing -> Remote Login: On

It has a green light, along with the following underneath it:

«To log in to this computer remotely, type «ssh myname@mycomputer».»

Great. So, I ssh to another machine, and type «ssh myname@mycomputer».

I get the result, «ssh: connect to host mycomputer port 22: Operation timed out».

So what’s going on here? I’ve even tried starting up sshd (ps -ef doesn’t show it running), with no luck. Everyone else in the department can connect to their own machines from outside the network (so there doesn’t seem to be a firewall blocking the network and restricting incoming connections), but I apparently can’t. Has anyone else seen similar behavior and figured out how to solve it? Thanks!

MacBook Pro, Mac OS X (10.5.8)

Posted on Oct 12, 2010 6:14 AM

All replies

Loading page content

Page content loaded

You should run 2 tests.

One test to a system where ssh works
One test to your Mac

Compare the ssh debug output from both connection attempts. Assuming the network paths are very similar, you should be able to see where in the connection sequence things go wrong.

Also do you have an system preferences -> Security -> Firewall settings that might get in the way?

Oct 12, 2010 9:00 AM

Hi Bob. Thanks for the comments. I did try disabling the firewall (and even restarting, since some comments suggested that a restart was needed), but nothing changed.

I’ve done the ssh -v -v -v test, and coming to my Mac the output is very simple. Only three lines, and it stops with the «Connecting to» line (following that line is a timed out line). For the machine where ssh is work, it has those same three lines, and then many more, as the connection proceeds.

I tried doing a port scan, and I found the result:
22/tcp filtered ssh
A similar scan on a working machine found
22/tcp open ssh

That made me think that perhaps there was something upstream doing some filtering (that and the fact that none of my ssh attempts showed up in /var/log/secure.log, whereas that file is full of ssh attempts on the other machine). I went to talk to some other people about it and was informed that the network is closed off from the rest of the world. When everyone else wants to ssh into the network, they go through an intermediate machine that is left exposed. I guess I got some incorrect information when I first asked.

I’ve tried to ssh from that machine (the one which has access to the network) into my Mac, and it works. Problem solved, although it means that I am condemned to only be able to scp from one direction. 🙂

Источник

SSH connection refused

adjplante

macrumors newbie

I use Mac OS X version 10.7.5 and my software is up to date.

Here is my problem: I tried to set ssh on my iMac. I am pretty sure that I am doing it OK since I have done this on my MacBook Pro, my girlfriend’s iMac and it works fine there. But on my iMac when I type the same command in X11, that is:

I get the following error:

ssh: connect to host localhost port 22: Connection refused

No matter what I do:
ssh andre@192.168.2.18
ssh andre@localhost
I always get the same error message.

Looks like ssh is working based on the (connect to host localhost port 22) of the error message but, on the other hand, I get the same message even if I turn off ssh by unchecking the Remote Login check box.

macrumors 65816

I use Mac OS X version 10.7.5 and my software is up to date.

Here is my problem: I tried to set ssh on my iMac. I am pretty sure that I am doing it OK since I have done this on my MacBook Pro, my girlfriend’s iMac and it works fine there. But on my iMac when I type the same command in X11, that is:

I get the following error:

ssh: connect to host localhost port 22: Connection refused

No matter what I do:
ssh andre@192.168.2.18
ssh andre@localhost
I always get the same error message.

Looks like ssh is working based on the (connect to host localhost port 22) of the error message but, on the other hand, I get the same message even if I turn off ssh by unchecking the Remote Login check box.

Try getting more information about what is going wrong by entering

adjplante

macrumors newbie

Try getting more information about what is going wrong by entering

Thanks for the reply LPZ

Here is the result

andre$ ssh -vvv localhost
OpenSSH_5.6p1, OpenSSL 0.9.8r 8 Feb 2011
debug1: Reading configuration data /etc/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to localhost [::1] port 22.
debug1: connect to address ::1 port 22: Connection refused
debug1: Connecting to localhost [127.0.0.1] port 22.
debug1: connect to address 127.0.0.1 port 22: Connection refused
debug1: Connecting to localhost [fe80::1%lo0] port 22.
debug1: connect to address fe80::1%lo0 port 22: Connection refused
ssh: connect to host localhost port 22: Connection refused​

macrumors 65816

Thanks for the reply LPZ

Here is the result

andre$ ssh -vvv localhost
OpenSSH_5.6p1, OpenSSL 0.9.8r 8 Feb 2011
debug1: Reading configuration data /etc/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to localhost [::1] port 22.
debug1: connect to address ::1 port 22: Connection refused
debug1: Connecting to localhost [127.0.0.1] port 22.
debug1: connect to address 127.0.0.1 port 22: Connection refused
debug1: Connecting to localhost [fe80::1%lo0] port 22.
debug1: connect to address fe80::1%lo0 port 22: Connection refused
ssh: connect to host localhost port 22: Connection refused​

I assume you have enabled Remote Login in the Sharing preference pane. What happens if you disable Remote Login and try

Источник

Question: Q: SSH Connection Refused, Possibly Permission Issue

we’ve had a rather bizarre problem with ssh for a while.
i’ll describe it as best as i can, and hopefully someone here can come up with a fix.

first, how it happened. we are a rather large marketing firm, and we frequently push out software using Casper. we started to notice some Leopard machines locking themselves out of ssh after we pushed out some printer installation packages.

second, the main symptoms. ssh connection is refused. however, remote login is shown as ON in System Preference, as well as in the terminal (/sbin/service —list). «netstat -anf inet» does NOT show port 22 as a listening port.

naturally, i tried to restart remote login. when done in System Preference, status says «ssh is shutting down» or something to that effect and just hangs. when done in terminal, «systemsetup -setremotelogin on» returns «ssh is already on», «systemsetup -setremotelogin off» returns nothing and ssh is NOT turned off. «/sbin/service serviceName stop» and «/sbin/service serviceName start» also don’t do a thing.

more information hopefully will find people who are looking into this thread:
1. the initial package push-out was performed on both Tiger and Leopard machines, and only Leopard machines were affected.
2. problem can be «temporarily» fixed by repairing permission and restarting, but it does come back. but because the problem doesn’t come back right away (sometimes it comes back after days), we have not been able to determine what makes the problem come back. to me this suggest a permission issue that is triggered by some background process.

Источник

Port 22: Connection Refused SSH Error

Recently, I signed new keys to gain access to my friend’s server. The keys were signed on my friend’s machine and I signed and added them to my .ssh folder. I attempted to sign in multiple times but I received an error:

This prompted me to try adding multiple keys into my .ssh folder for access to my friend’s device. I could get nothing to work.

I then generated a key pair from my own machine, and I handed it to my friend to add to their server. Soon, I was able to SSH into the server.

However, the next day, I am receiving an error:

I’m running MacOS Mojave 10.14.6 on my macbook pro.

I tried uninstalling and reinstalling OpenSSH via Brew, but there was no improvement. Additionally, I tried SSHing over port 2222, which also failed.

Additionally, I tried accessing two different servers and my SSH request failed on both attempts, so it seems a client side issue.

I’m rather new to working in the terminal over mac, so any and all advice would be appreciated. Below is the verbose error log.

Currently, I am receiving a different error, and both seem to be related.

Both servers which I’ve tried to SSH into are running some form of linux. (I don’t have current My friend is still able to access their server from their account, and the school server which I’m attempting to access also allows SSH for other users. Both ports 22 are open on the machines.

Any diagnostic advice or recommendations for my issue?

Update: I rebooted my Mac, and I ran ssh -vvv [user]@utdallas.edu The first time I tried it it said:

I ran it again and got a different error. All subsequent errors are of this form.

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

  • Mac os sql server
  • Mac os spotlight не работает
  • Mac os source tree
  • Mac os software development platform
  • Mac os snow leopard оригинальный образ