You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Why is port 22 closed (with SSH enabled) with recent Monterey update?

I use SFTP often and went to transfer some files yesterday. But, instead Monterey says no! Permission denied, connection closed. That's all I get. A check of open ports on the Mac show it is not open. However, if I SSH into 127.0.0.1 the server works fine. It's just not listening and I don't know if this is a Monterey bug or but it sure had worked great for a long time.

Mac mini 2018 or later

Posted on May 2, 2022 4:25 AM

Reply
Question marked as Top-ranking reply

Posted on May 4, 2022 5:44 AM

Sirdotcom wrote:

Using ssh/sftp has never been a problem, only inbound. It has to come from the other end which is a joke of WSL and windows. But still my machine is not even listening on :22. SCP is a great alternative, so I'll use that.

I'm not sure what you are saying here. To clarify...


You need to go to System Preferences > Sharing and enable "Remote login" to use ssh or sftp. If your user account isn't an administrator, you will need to change the "Allow access for" value too. There is a new setting to Allow full disk access for remote users. You might need that if you are trying to access any of the protected folders like Desktop, Documents, or Downloads.


I just tested ssh and sftp, both outgoing and incoming, and they work fine in Monterey.


Regarding sftp, I recommend scp instead. Perhaps the biggest problem with sftp is that it is easily confused with ftps, or "secure ftp". I think I did that when I initially ready your post. I hadn't used sftp in years and had forgotten about it. Are you sure you are are using sftp and not ftps? ftps is a true nightmare and should be avoided at all costs.

Similar questions

6 replies
Question marked as Top-ranking reply

May 4, 2022 5:44 AM in response to Sirdotcom

Sirdotcom wrote:

Using ssh/sftp has never been a problem, only inbound. It has to come from the other end which is a joke of WSL and windows. But still my machine is not even listening on :22. SCP is a great alternative, so I'll use that.

I'm not sure what you are saying here. To clarify...


You need to go to System Preferences > Sharing and enable "Remote login" to use ssh or sftp. If your user account isn't an administrator, you will need to change the "Allow access for" value too. There is a new setting to Allow full disk access for remote users. You might need that if you are trying to access any of the protected folders like Desktop, Documents, or Downloads.


I just tested ssh and sftp, both outgoing and incoming, and they work fine in Monterey.


Regarding sftp, I recommend scp instead. Perhaps the biggest problem with sftp is that it is easily confused with ftps, or "secure ftp". I think I did that when I initially ready your post. I hadn't used sftp in years and had forgotten about it. Are you sure you are are using sftp and not ftps? ftps is a true nightmare and should be avoided at all costs.

May 2, 2022 4:31 AM in response to Sirdotcom

Sirdotcom wrote:

I use SFTP often and went to transfer some files yesterday. But, instead Monterey says no! Permission denied, connection closed. That's all I get. A check of open ports on the Mac show it is not open. However, if I SSH into 127.0.0.1 the server works fine. It's just not listening and I don't know if this is a Monterey bug or but it sure had worked great for a long time.



TCP and UDP ports used by Apple software products - Apple Support



SFTP stopped working after Monterey upgra… - Apple Community


May 4, 2022 4:46 AM in response to etresoft

etresoft wrote:

If you can ssh, then port 22 is working fine. sftp is something different.

Try using the "scp" tool instead. This is just cp over ssh.


Thanks! Good to know. Using ssh/sftp has never been a problem, only inbound. It has to come from the other end which is a joke of WSL and windows. But still my machine is not even listening on :22. SCP is a great alternative, so I'll use that.

May 4, 2022 6:00 AM in response to etresoft

Thanks for the info. I have been using SFTP (not ftps) inbound for some time now without any problem. (And yes, all the sharing and other options are right.) But it just stopped working. As in, the SSH service won't even run on my trouble machine. It's like it was intentionally disabled or something. I don't know, but I'll use SCP and the next time I wipe/reinstall it will probably work again. SCP will be fine.

Why is port 22 closed (with SSH enabled) with recent Monterey update?

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