Remote login (SSH) not working/very slow

Hi!


I just bought a Mac mini 2 today (my first apple product) and I try to set up remote login so I can connect from one of my other computers into the Mac with SSH.


I have enabled remote login and selected users that should be allowed. When I try to ssh into the Mac i am prompted for the password and it seems to accept the password but then nothing more happens.


this is what it looks like in the console from the shell where I try to remote into the Mac:


ssh martin@192.168.10.124

(martin@192.168.10.124) Password:


I provide the password and then nothing more happens.

If I intentionally give the wrong password the prompt just repeats so it seems to have contact. I can SSH between other computers on the same WIFI with excellent performance, and interestingly the Mac can ssh into other computers but it is very(!) slow.


This is ultra frustrating because if this does not work the whole purpose of getting this Mac is gone.


What can be the problem?


Mac mini

Posted on Feb 24, 2023 4:13 PM

Reply
Question marked as Top-ranking reply

Posted on Feb 24, 2023 4:31 PM

What happens when you launch Applications -> Terminal on the new Mac? Does it give you a prompt and let you issue commands?


You could try

ssh -v -v -v username@new.macs.address


Then do the same thing to an system you know works

ssh -v -v -v username@known.good.system


Now look at the output from each ssh connection, especially near the end, and see if there is anything significantly different.


On your new Mac, you could also try

ssh username@localhost

and see if that works.


Finally, on your new Mac, you could look at /var/log/system.log and see if there are any sshd entries near the end of the file. Maybe even on the new Mac, issue the command:

tail -f /var/log/system.log

and watch it when you attempt to ssh into the new Mac.


PS. I have been using ssh with my Macs (and Linux, Solaris, AIX, Window, etc...) for years.

Similar questions

4 replies
Question marked as Top-ranking reply

Feb 24, 2023 4:31 PM in response to MartinHSchei

What happens when you launch Applications -> Terminal on the new Mac? Does it give you a prompt and let you issue commands?


You could try

ssh -v -v -v username@new.macs.address


Then do the same thing to an system you know works

ssh -v -v -v username@known.good.system


Now look at the output from each ssh connection, especially near the end, and see if there is anything significantly different.


On your new Mac, you could also try

ssh username@localhost

and see if that works.


Finally, on your new Mac, you could look at /var/log/system.log and see if there are any sshd entries near the end of the file. Maybe even on the new Mac, issue the command:

tail -f /var/log/system.log

and watch it when you attempt to ssh into the new Mac.


PS. I have been using ssh with my Macs (and Linux, Solaris, AIX, Window, etc...) for years.

Feb 25, 2023 1:14 AM in response to BobHarris

Yes - I can open the terminal on my Mac and use it just as I can on my Linux box, the terminal itself seems to operate as expected.


This works perfect on my Mac

ssh developer@localhost


I tried this from my linux box into the Mac:


ssh -v -v -v developer@martins-mini.home


It printed at lot of debug data in the terminal and ended up asking for password for the developer account on the Mac. I provided the password, it printed again a lot of debug data and halted on this line for 2-3 minutes:


debug2: channel 0: open confirm window 0 max 32768.


it then printed:


debug3: send packet: type 1
client_loop: send disconnect: Broken pipe


and then returns to the linux terminal.


I tried the same again and then I actually was able to get a remote shell on the Mac and I can see the home directory of the developer user. I tried to do a ls and it worked, it did it once more and it hanged for 1-2 minutes when it then printed:


debug2: client_check_window_change: changed
debug3: channel 0: request window-change confirm 0
debug3: send packet: type 98


these three lines were printed in a total of 5 times and then it was just stuck there and the terminal on the linux box just hangs and I must close it manually.


#####


I then tried ssh -v -v -v martin@192.168.10.137


192.168.10.137 is my linux box to which I can ssh very smoothly from my windows box.


developer@Martins-Mac-mini ~ % ssh -v -v -v martin@192.168.10.137

OpenSSH_9.0p1, LibreSSL 3.3.6

debug1: Reading configuration data /etc/ssh/ssh_config

debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files

debug1: /etc/ssh/ssh_config line 54: Applying options for *

debug2: resolve_canonicalize: hostname 192.168.10.137 is address

debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/Users/developer/.ssh/known_hosts'

debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/Users/developer/.ssh/known_hosts2'

debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling

debug3: ssh_connect_direct: entering

debug1: Connecting to 192.168.10.137 [192.168.10.137] port 22.

debug3: set_sock_tos: set socket 3 IP_TOS 0x48

debug1: connect to address 192.168.10.137 port 22: Operation timed out

ssh: connect to host 192.168.10.137 port 22: Operation timed out

developer@Martins-Mac-mini ~ % 


Turns out that when pinging my Mac from the linux or windows box it sometimes works but often it timeouts or is unreachable.


Trying to ping windows box from Mac also suffers the same


developer@Martins-Mac-mini ~ % ping 192.169.10.137

PING 192.169.10.137 (192.169.10.137): 56 data bytes

Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
.....



This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Remote login (SSH) not working/very slow

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.