MC on Tumbleweed doesn't check ~/.ssh/config for Host/Port or use public/private keys on first connect?
All, Patrick was having issues with ssh/sftp in MC on TW so I was troubleshooting on my TW install. The F1 "help" says mc will check ~/.ssh/known_hosts and use public/private keys. However, on first connection with mc, the password dialog is shown and a password is required. This doesn't fly if sshd/PasswordAuthentication is set to No to disable password auth. However on second connect, or reconnecting, to the remote with sftp, no password dialog is displayed. (key agent or something must be allowing it or some internal mc process) Should using the Left/Right menu "SFTP Link ..." command or connecting from the command-line in mc with: cd sftp://user@host:port/path/to use host public/private key-pairs on first connection? If so, is this a bug? Can somebody confirm on TW the behavior they see with mc. Thanks. If it is a bug I'll file it. Currently: https://bugzilla.opensuse.org/buglist.cgi?quicksearch=midnight%20commander&list_id=14039128 doesn't show anything listed regarding this behavior. Though I can confirm behavior in: (mc-wrapper.sh does not exit to current dir any longer) https://bugzilla.opensuse.org/show_bug.cgi?id=1203617 and (slow start on some boxes and not others) https://bugzilla.opensuse.org/show_bug.cgi?id=1175930 -- David C. Rankin, J.D.,P.E.
On 2024-10-07 06:03, David C. Rankin wrote:
All,
Patrick was having issues with ssh/sftp in MC on TW so I was troubleshooting on my TW install.
The F1 "help" says mc will check ~/.ssh/known_hosts and use public/private keys. However, on first connection with mc, the password dialog is shown and a password is required. This doesn't fly if sshd/PasswordAuthentication is set to No to disable password auth.
So that you can compare, I tried on Leap 15.5. I open sftp via menu right/sftp to another local machine. I simply enter user@machine and I enter with no password nor phrase, because at some point in the graphical session I have logged in with ssh, or maybe in another 'mc' with sftp, and the password agent remembers the passphrase. In reverse direction it asks for my password. -- Cheers / Saludos, Carlos E. R. (from 15.5 x86_64 at Telcontar)
On 10/7/24 6:31 AM, Carlos E. R. wrote:
On 2024-10-07 06:03, David C. Rankin wrote:
All,
Patrick was having issues with ssh/sftp in MC on TW so I was troubleshooting on my TW install.
The F1 "help" says mc will check ~/.ssh/known_hosts and use public/private keys. However, on first connection with mc, the password dialog is shown and a password is required. This doesn't fly if sshd/PasswordAuthentication is set to No to disable password auth.
So that you can compare, I tried on Leap 15.5.
I open sftp via menu right/sftp to another local machine. I simply enter
user@machine
and I enter with no password nor phrase, because at some point in the graphical session I have logged in with ssh, or maybe in another 'mc' with sftp, and the password agent remembers the passphrase.
In reverse direction it asks for my password.
Yes, this is my experience as well. You can test the mc-cli with cd sftp://user@host:port/path/to the [user@] and [:port] are optional, if needed. I've tried with the full string including :port to a box with ssh on a high-port and mc connects fine, but I have to include the :port as mc isn't checking ~/.ssh/config. The first time I'm presented with the pw dialog even though I have public/private key access to that box and I have to specify the port even though the Host/Port pair is set in ~/.ssh/config. So mc is working with ssh/sftp, but it isn't checking the ~/.ssh configuration file and isn't trying the public/private keys on first connection to the remote host. As with you, ssh-agent appears to provide the credential if I disconnect/reconnect within mc after the first connection. To me this looks like a bug. mc should use the Host/Port from ~/.ssh/config and it should try connecting with public/private keys just like ssh does. Maybe that's the issue, ssh does a full implementation of all the config and keys for its connection, but mc simply doesn't and just relies on ssh-agent to allow reconnect. Also strange since I've previously connected to all hosts in konsole before launching mc in a konsole session attached to the local machine. Will have to dig through the mc source to figure out whether it makes any attempt to use the config or keys on first connection or if those features simply are not implemented. -- David C. Rankin, J.D.,P.E.
participants (2)
-
Carlos E. R.
-
David C. Rankin