echodot-llc / Red

3 stars 0 forks source link

When using a favorite to connect via SSH, it prompts for an SSH Password when one is already saved #5

Closed gilletty closed 3 years ago

echodot-llc commented 4 years ago

Thank you for the excellent bug reports. I'll check into this one.

echodot-llc commented 4 years ago

I can't replicate this issue. SSH will prompt for a password if the saved password is incorrect; Could you double-check this for me by retyping your password on the favorites screen to see if that is the case?

If it still doesn't work, could you let me know what version of MacOS are you using?

gilletty commented 4 years ago

It might have to do with typing in the port each time due to issue #4. Once that issue is resolved, I'll test this again. Thanks.

gilletty commented 4 years ago

I'm still seeing the same issue and verified that the SSH Password is correct. I'm running macOS 10.15.5.

echodot-llc commented 4 years ago

Thanks for checking. I'll try to replicate with that point release of Catalina.

seelensonne commented 4 years ago

Just to confirm gilletty’s report: After launch, Red prompts for SSH credentials for every single connection saved as a Favorite.

This happens with Red 1.5.2 (Build 4172, Mac App Store version) on macOS Catalina 10.15.5.

Steps to Reproduce

  1. Create a Favorite, connecting via SSH
  2. Enter SSH Host, SSH User, select a Private SSH Key, leave Port blank (i.e., default to 22)
  3. Click Connect to successfully connect
  4. Quit Red
  5. Relaunch Red
  6. Click Connect on the Favorite created in step 1

Expected

Actual

echodot-llc commented 4 years ago

This appears to be an issue with Catalina's security regarding file permissions. When you open a file, the OS authorizes the app to have access to the file in the future. For some reason, this is working fine when I try it on Catalina. Please message me if you'd be willing to run a debug version of Red and send me what is sent to Console.app.

seelensonne commented 4 years ago

It's indeed related to Catalina's sandboxing. Did you (on your Catalina machine) grant Full Disk Access to Red? Or any other special File and Folders Access?

My workaround for Catalina is as follows:

  1. Create a new subdirectory inside of Red's container (e.g., mkdir ~/Library/Containers/com.echodot.Red/Data/Library/Application\ Support/Red/SSHKeys)
  2. Copy private SSH keys there (a symlink isn't enough; it gets resolved back to the original location, which is again outside of Red's container)
  3. In Red, pick the private SSH key in the newly directory

This works fine. It's a bit awkward, but not terribly so.

echodot-llc commented 4 years ago

Great thought for a workaround. And thanks for confirming the issue.

My Catalina development box doesn't have any access permissions set up, but I've found a number of things where the behavior changes when run on a separate machine. I'll set up another Catalina machine and see if I can replicate the bug that way.

Again - if there's anyone willing to run a version of Red that outputs some debug information please let me know. There's a professional license code for the first person willing to help out. (Send your email to me at https://echodot.com/contact/ and I'll send along the instructions.)

seelensonne commented 4 years ago

As of Red 1.5.11 and macOS 10.15.6, the issue seems resolved. I was not able not reproduce it with the debug build, nor the official Mac App Store version.

Note: If anybody with Red 1.5.11 or newer still gets prompted for an SSH password during key-based login, delete the affected favorite, and re-create it. That's what fixed all the "bad" favorites I had created with earlier versions of Red.

echodot-llc commented 3 years ago

Closing. Appears to have been fixed in 1.5.10. Please see above post for a solution if the issue originated in an older Red build.

Many thanks to @seelensonne for the in-depth research and reporting.