neuropoly / data-management

Repo that deals with datalad aspects for internal use
4 stars 0 forks source link

Asking for password #154

Closed jcohenadad closed 2 years ago

jcohenadad commented 2 years ago

a git-annexed repos is asking for my password, i give it, but it fails:

julien-macbook:~/data.neuro/basel-mp2rage $ git pull && git annex sync --no-content && git annex get .
git@132.207.65.204's password: 
Permission denied, please try again.

is there a glitch? @kousu

kousu commented 2 years ago

It looks like maybe your ~/.ssh/config is confused. It should be asking "git@data.neuro.polymtl.ca's password: ". That it's not means something has gone wonky. Can you compare it to https://intranet.neuro.polymtl.ca/computing-resources/neuropoly/README.html#ssh-command-line ?

Also show me ssh -v git@data.neuro.polymtl.ca?

jcohenadad commented 2 years ago

here's my .ssh/config:

Terminal output ```console Host * ControlMaster auto ControlPath ~/.ssh/%r@%h:%p ControlPersist 3s AddKeysToAgent yes UseKeychain yes IdentityFile ~/.ssh/id_rsa ForwardX11Trusted yes # ForwardX11 yes # XAuthLocation /opt/local/bin/xauth Host joplin HostName joplin.neuro.polymtl.ca Host ferguson HostName ferguson.neuro.polymtl.ca Host abbey HostName abbey.neuro.polymtl.ca Host bireli HostName bireli.neuro.polymtl.ca Host rosenberg HostName rosenberg.neuro.polymtl.ca Host romane HostName romane.neuro.polymtl.ca Host tristano HostName tristano.neuro.polymtl.ca Host data HostName data.neuro.polymtl.ca User git Match host *.neuro.polymtl.ca User p101317 HostName 132.207.65.204 ForwardX11Trusted yes #ForwardX11 yes #XAuthLocation /opt/local/bin/xauth XAuthLocation /opt/X11/bin/xauth PreferredAuthentications password ```

i changed it for the ssh/config you pointed out, and now it is asking for the right thing:

git@data.neuro.polymtl.ca's password: 

however, when i enter my GRAMES passwd, it still doesn't work.

Terminal output ```console julien-macbook:~/data.neuro/spine-generic-processed $ ssh -v git@data.neuro.polymtl.ca OpenSSH_8.1p1, LibreSSL 2.7.3 debug1: Reading configuration data /Users/julien/.ssh/config debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 47: Applying options for * debug1: Connecting to data.neuro.polymtl.ca port 22. debug1: Connection established. debug1: identity file /Users/julien/.ssh/id_rsa type 0 debug1: identity file /Users/julien/.ssh/id_rsa-cert type -1 debug1: identity file /Users/julien/.ssh/id_dsa type -1 debug1: identity file /Users/julien/.ssh/id_dsa-cert type -1 debug1: identity file /Users/julien/.ssh/id_ecdsa type -1 debug1: identity file /Users/julien/.ssh/id_ecdsa-cert type -1 debug1: identity file /Users/julien/.ssh/id_ed25519 type -1 debug1: identity file /Users/julien/.ssh/id_ed25519-cert type -1 debug1: identity file /Users/julien/.ssh/id_xmss type -1 debug1: identity file /Users/julien/.ssh/id_xmss-cert type -1 debug1: Local version string SSH-2.0-OpenSSH_8.1 debug1: Remote protocol version 2.0, remote software version OpenSSH_8.3p1 Ubuntu-1ubuntu0.1 debug1: match: OpenSSH_8.3p1 Ubuntu-1ubuntu0.1 pat OpenSSH* compat 0x04000000 debug1: Authenticating to data.neuro.polymtl.ca:22 as 'git' debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: algorithm: curve25519-sha256 debug1: kex: host key algorithm: ecdsa-sha2-nistp256 debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: compression: none debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: compression: none debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: Server host key: ecdsa-sha2-nistp256 SHA256:s8PdMunbOv9abtSQX8/tPW3VASKPl5jQ5hhki4Mt7wE debug1: Host 'data.neuro.polymtl.ca' is known and matches the ECDSA host key. debug1: Found key in /Users/julien/.ssh/known_hosts:35 debug1: rekey out after 134217728 blocks debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: rekey in after 134217728 blocks debug1: Will attempt key: /Users/julien/.ssh/id_rsa RSA SHA256:Ss3ePRjzwzjZAUYmqItooySyJdtd2UvlqbDZ5UaIAHo debug1: Will attempt key: /Users/julien/.ssh/id_dsa debug1: Will attempt key: /Users/julien/.ssh/id_ecdsa debug1: Will attempt key: /Users/julien/.ssh/id_ed25519 debug1: Will attempt key: /Users/julien/.ssh/id_xmss debug1: SSH2_MSG_EXT_INFO received debug1: kex_input_ext_info: server-sig-algs= debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey,password debug1: Next authentication method: password ```
kousu commented 2 years ago

The problem is there's a tension between https://github.com/neuropoly/data-management/issues/22 and https://github.com/neuropoly/computers/issues/90. gitolite doesn't work with grames passwords and /mnt/duke doesn't with without them.

It would be cool if we could get them plugged in together but it's actually rather difficult.... for now we just have to respect ssh keys. You can add this line to get it working again (a correction I made 6 days ago: https://github.com/neuropoly/intranet.neuro.polymtl.ca/commit/5ed0e14becc89241680212298007fa27b816a6c1#diff-886e3c8ca9aaf0589a3fb004d29a7606ff201071094f6f179d57eb5faab33e3e)

  HostName data.neuro.polymtl.ca
  User git
+PreferredAuthentications pubkey
jcohenadad commented 2 years ago

Thank you @kousu, it solved it. So i understand that by changing passwd to pubkey, i won't be able to see the mounted duke on the stations anymore (because of https://github.com/neuropoly/computers/issues/90), and so i need to manually change it back to 'passwd' to fix it when i need it, is that right?

kousu commented 2 years ago

That change only applies to data, which you never connect in to. It isn't even itself connected to duke because there's never any need for that.

You should be able to confirm that you get a password prompt and can access duke elsewhere by ssh -v joplin ls /mnt/duke/projects/

jcohenadad commented 2 years ago

hum, i get a permission denied:

Terminal output ```console julien-macbook:~/data.neuro/spine-generic-processed $ ssh -v joplin ls /mnt/duke/projects/ OpenSSH_8.1p1, LibreSSL 2.7.3 debug1: Reading configuration data /Users/julien/.ssh/config debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 47: Applying options for * debug1: Connecting to joplin.neuro.polymtl.ca port 22. debug1: Connection established. debug1: identity file /Users/julien/.ssh/id_rsa type 0 debug1: identity file /Users/julien/.ssh/id_rsa-cert type -1 debug1: identity file /Users/julien/.ssh/id_dsa type -1 debug1: identity file /Users/julien/.ssh/id_dsa-cert type -1 debug1: identity file /Users/julien/.ssh/id_ecdsa type -1 debug1: identity file /Users/julien/.ssh/id_ecdsa-cert type -1 debug1: identity file /Users/julien/.ssh/id_ed25519 type -1 debug1: identity file /Users/julien/.ssh/id_ed25519-cert type -1 debug1: identity file /Users/julien/.ssh/id_xmss type -1 debug1: identity file /Users/julien/.ssh/id_xmss-cert type -1 debug1: Local version string SSH-2.0-OpenSSH_8.1 debug1: Remote protocol version 2.0, remote software version OpenSSH_8.2p1 Ubuntu-4ubuntu0.3 debug1: match: OpenSSH_8.2p1 Ubuntu-4ubuntu0.3 pat OpenSSH* compat 0x04000000 debug1: Authenticating to joplin.neuro.polymtl.ca:22 as 'p101317' debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: algorithm: curve25519-sha256 debug1: kex: host key algorithm: ecdsa-sha2-nistp256 debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: compression: none debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: compression: none debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: Server host key: ecdsa-sha2-nistp256 SHA256:56hmw5QTBPxAsRoLIU6qA0kxAbXLJhO60S1zzMFhR+0 debug1: Host 'joplin.neuro.polymtl.ca' is known and matches the ECDSA host key. debug1: Found key in /Users/julien/.ssh/known_hosts:1 debug1: rekey out after 134217728 blocks debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: rekey in after 134217728 blocks debug1: Will attempt key: /Users/julien/.ssh/id_rsa RSA SHA256:Ss3ePRjzwzjZAUYmqItooySyJdtd2UvlqbDZ5UaIAHo debug1: Will attempt key: /Users/julien/.ssh/id_dsa debug1: Will attempt key: /Users/julien/.ssh/id_ecdsa debug1: Will attempt key: /Users/julien/.ssh/id_ed25519 debug1: Will attempt key: /Users/julien/.ssh/id_xmss debug1: SSH2_MSG_EXT_INFO received debug1: kex_input_ext_info: server-sig-algs= debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey,password debug1: No more authentication methods to try. p101317@joplin.neuro.polymtl.ca: Permission denied (publickey,password). ```

maybe related to https://github.com/neuropoly/data-management/issues/155?

kousu commented 2 years ago

Can I please see ~/.ssh/config in its full current state?

jcohenadad commented 2 years ago
Terminal output ```console julien-macbook:~/.ssh $ cat ~/.ssh/config # GPU servers Match Host romane,rosenberg,bireli HostName %h.neuro.polymtl.ca # CPU servers Match Host joplin,abbey,tristano HostName %h.neuro.polymtl.ca # Workstations Match Host ferguson,davis HostName %h.neuro.polymtl.ca # data servers Match Host data HostName %h.neuro.polymtl.ca User git PreferredAuthentications publickey Match host *.neuro.polymtl.ca User p101317 # passwords are required to access /mnt/duke: https://github.com/neuropoly/computers/issues/90: PreferredAuthentications pubkey ```
kousu commented 2 years ago

The last line needs to say PreferredAuthentications password, that should get it working again.

jcohenadad commented 2 years ago

ah! indeed i modified the wrong line when implementing https://github.com/neuropoly/data-management/issues/154#issuecomment-983818916.

now it looks like:

Terminal output ```console # GPU servers Match Host romane,rosenberg,bireli HostName %h.neuro.polymtl.ca # CPU servers Match Host joplin,abbey,tristano HostName %h.neuro.polymtl.ca # Workstations Match Host ferguson,davis HostName %h.neuro.polymtl.ca # data servers Match Host data HostName %h.neuro.polymtl.ca User git PreferredAuthentications pubkey Match host *.neuro.polymtl.ca User p101317 # passwords are required to access /mnt/duke: https://github.com/neuropoly/computers/issues/90: PreferredAuthentications password ```

so i changed the last line, but also the line about the data server:

PreferredAuthentications publickey --> PreferredAuthentications pubkey

now, i can connect to the stations again, but i still cannot get the data:

julien-macbook:~/data.neuro/spine-generic-processed $ git pull && git annex sync --no-content && git annex get .
git@data.neuro.polymtl.ca's password: 
Permission denied, please try again.
git@data.neuro.polymtl.ca's password: 
kousu commented 2 years ago

The config in https://intranet.neuro.polymtl.ca/computing-resources/neuropoly/README.html#ssh-command-line is working for me, under Linux.

``` $ cat ~/.ssh/config_neuropoly # GPU servers Match Host romane,rosenberg,bireli HostName %h.neuro.polymtl.ca # CPU servers Match Host joplin,abbey,tristano HostName %h.neuro.polymtl.ca # Workstations Match Host ferguson,davis HostName %h.neuro.polymtl.ca # data servers Match Host data HostName %h.neuro.polymtl.ca User git PreferredAuthentications publickey Match host *.neuro.polymtl.ca User p115628 # passwords are required to access /mnt/duke: https://github.com/neuropoly/computers/issues/90: PreferredAuthentications password ```
``` $ ssh -v data OpenSSH_8.8p1, OpenSSL 1.1.1l 24 Aug 2021 debug1: Reading configuration data /home/kousu/.ssh/config debug1: /home/kousu/.ssh/config line 3: Applying options for * debug1: Reading configuration data /home/kousu/.ssh/config_personal debug1: Reading configuration data /home/kousu/.ssh/config_neuropoly debug1: Reading configuration data /etc/ssh/ssh_config debug1: auto-mux: Trying existing master debug1: Control socket "/home/kousu/.ssh/git@data.neuro.polymtl.ca:22" does not exist debug1: Connecting to data.neuro.polymtl.ca [132.207.65.204] port 22. debug1: Connection established. debug1: identity file /home/kousu/.ssh/id_rsa type 0 debug1: identity file /home/kousu/.ssh/id_rsa-cert type -1 debug1: identity file /home/kousu/.ssh/id_dsa type -1 debug1: identity file /home/kousu/.ssh/id_dsa-cert type -1 debug1: identity file /home/kousu/.ssh/id_ecdsa type -1 debug1: identity file /home/kousu/.ssh/id_ecdsa-cert type -1 debug1: identity file /home/kousu/.ssh/id_ecdsa_sk type -1 debug1: identity file /home/kousu/.ssh/id_ecdsa_sk-cert type -1 debug1: identity file /home/kousu/.ssh/id_ed25519 type 3 debug1: identity file /home/kousu/.ssh/id_ed25519-cert type -1 debug1: identity file /home/kousu/.ssh/id_ed25519_sk type -1 debug1: identity file /home/kousu/.ssh/id_ed25519_sk-cert type -1 debug1: identity file /home/kousu/.ssh/id_xmss type -1 debug1: identity file /home/kousu/.ssh/id_xmss-cert type -1 debug1: Local version string SSH-2.0-OpenSSH_8.8 debug1: Remote protocol version 2.0, remote software version OpenSSH_8.3p1 Ubuntu-1ubuntu0.1 debug1: compat_banner: match: OpenSSH_8.3p1 Ubuntu-1ubuntu0.1 pat OpenSSH* compat 0x04000000 debug1: Authenticating to data.neuro.polymtl.ca:22 as 'git' debug1: load_hostkeys: fopen /home/kousu/.ssh/known_hosts2: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: algorithm: curve25519-sha256 debug1: kex: host key algorithm: ecdsa-sha2-nistp256 debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: compression: none debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: compression: none debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: SSH2_MSG_KEX_ECDH_REPLY received debug1: Server host key: ecdsa-sha2-nistp256 SHA256:s8PdMunbOv9abtSQX8/tPW3VASKPl5jQ5hhki4Mt7wE debug1: load_hostkeys: fopen /home/kousu/.ssh/known_hosts2: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory debug1: Host 'data.neuro.polymtl.ca' is known and matches the ECDSA host key. debug1: Found key in /home/kousu/.ssh/known_hosts:74 debug1: rekey out after 134217728 blocks debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: rekey in after 134217728 blocks debug1: pubkey_prepare: ssh_get_authentication_socket: No such file or directory debug1: Will attempt key: /home/kousu/.ssh/id_rsa RSA SHA256:GSSwEyBD36nxOSBPAWx2D8UX5K1emE6ZCiAuIKjljnU debug1: Will attempt key: /home/kousu/.ssh/id_dsa debug1: Will attempt key: /home/kousu/.ssh/id_ecdsa debug1: Will attempt key: /home/kousu/.ssh/id_ecdsa_sk debug1: Will attempt key: /home/kousu/.ssh/id_ed25519 ED25519 SHA256:gheZ5HA8sJXBBRY8+5h57/ERWSxTTey0jOxYYSm26PE debug1: Will attempt key: /home/kousu/.ssh/id_ed25519_sk debug1: Will attempt key: /home/kousu/.ssh/id_xmss debug1: SSH2_MSG_EXT_INFO received debug1: kex_input_ext_info: server-sig-algs= debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey,password debug1: Next authentication method: publickey debug1: Offering public key: /home/kousu/.ssh/id_rsa RSA SHA256:GSSwEyBD36nxOSBPAWx2D8UX5K1emE6ZCiAuIKjljnU debug1: Authentications that can continue: publickey,password debug1: Trying private key: /home/kousu/.ssh/id_dsa debug1: Trying private key: /home/kousu/.ssh/id_ecdsa debug1: Trying private key: /home/kousu/.ssh/id_ecdsa_sk debug1: Offering public key: /home/kousu/.ssh/id_ed25519 ED25519 SHA256:gheZ5HA8sJXBBRY8+5h57/ERWSxTTey0jOxYYSm26PE debug1: Server accepts key: /home/kousu/.ssh/id_ed25519 ED25519 SHA256:gheZ5HA8sJXBBRY8+5h57/ERWSxTTey0jOxYYSm26PE Enter passphrase for key '/home/kousu/.ssh/id_ed25519': Authenticated to data.neuro.polymtl.ca ([132.207.65.204]:22) using "publickey". debug1: setting up multiplex master socket debug1: channel 0: new [/home/kousu/.ssh/git@data.neuro.polymtl.ca:22] debug1: control_persist_detach: backgrounding master process debug1: forking to background debug1: Entering interactive session. debug1: pledge: id debug1: multiplexing control connection debug1: channel 1: new [mux-control] debug1: channel 2: new [client-session] debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0 debug1: client_input_hostkeys: searching /home/kousu/.ssh/known_hosts for data.neuro.polymtl.ca / (none) debug1: client_input_hostkeys: searching /home/kousu/.ssh/known_hosts2 for data.neuro.polymtl.ca / (none) debug1: client_input_hostkeys: hostkeys file /home/kousu/.ssh/known_hosts2 does not exist debug1: client_input_hostkeys: host key found matching a different name/address, skipping UserKnownHostsFile update debug1: Remote: /srv/git/.ssh/authorized_keys:22: key options: command user-rc debug1: Remote: /srv/git/.ssh/authorized_keys:22: key options: command user-rc debug1: mux_client_request_session: master session id: 2 PTY allocation request failed hello nguenther, this is git@data running gitolite3 3.6.11-2 (Debian) on git 2.27.0 R C datasets/..* R W datasets/basel-mp2rage R W datasets/data-single-subject_DO-NOT-USE R W datasets/data_axondeepseg_tem R W datasets/levin-stroke R W datasets/model_seg_exvivo_gm-wm_t2_unet2d-multichannel-softseg R W datasets/msseg_challenge_2016 R W datasets/msseg_challenge_2021 R W datasets/sci-colorado R W datasets/sci-zurich R W datasets/sct-testing-large R W datasets/spine-generic-processed R W datasets/uk-biobank R W datasets/uk-biobank-processed R W datasets/umass-ms-ge-excite1.5 R W datasets/umass-ms-ge-hdxt1.5 R W datasets/umass-ms-ge-pioneer3 R W datasets/umass-ms-siemens-espree1.5 R W datasets/wakehealth R W gitolite-admin Please see https://github.com/neuropoly/data-management/blob/master/internal-server.md for more help debug1: client_input_channel_req: channel 2 rtype exit-status reply 0 debug1: client_input_channel_req: channel 2 rtype eow@openssh.com reply 0 debug1: channel 2: free: client-session, nchannels 3 debug1: channel 1: free: mux-control, nchannels 2 Shared connection to data.neuro.polymtl.ca closed. ```

The key log lines are

debug1: Offering public key: /home/kousu/.ssh/id_rsa RSA SHA256:GSSwEyBD36nxOSBPAWx2D8UX5K1emE6ZCiAuIKjljnU
debug1: Offering public key: /home/kousu/.ssh/id_ed25519 ED25519 SHA256:gheZ5HA8sJXBBRY8+5h57/ERWSxTTey0jOxYYSm26PE

Does yours try any key files?

kousu commented 2 years ago

Is it possible you simply never inscribed your macbook onto data.neuro?

jcohenadad commented 2 years ago

it does try some key files:

Terminal output ```console julien-macbook:~/data.neuro/basel-mp2rage $ ssh -v data OpenSSH_8.1p1, LibreSSL 2.7.3 debug1: Reading configuration data /Users/julien/.ssh/config debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 47: Applying options for * debug1: Connecting to data.neuro.polymtl.ca port 22. debug1: Connection established. debug1: identity file /Users/julien/.ssh/id_rsa type 0 debug1: identity file /Users/julien/.ssh/id_rsa-cert type -1 debug1: identity file /Users/julien/.ssh/id_dsa type -1 debug1: identity file /Users/julien/.ssh/id_dsa-cert type -1 debug1: identity file /Users/julien/.ssh/id_ecdsa type -1 debug1: identity file /Users/julien/.ssh/id_ecdsa-cert type -1 debug1: identity file /Users/julien/.ssh/id_ed25519 type -1 debug1: identity file /Users/julien/.ssh/id_ed25519-cert type -1 debug1: identity file /Users/julien/.ssh/id_xmss type -1 debug1: identity file /Users/julien/.ssh/id_xmss-cert type -1 debug1: Local version string SSH-2.0-OpenSSH_8.1 debug1: Remote protocol version 2.0, remote software version OpenSSH_8.3p1 Ubuntu-1ubuntu0.1 debug1: match: OpenSSH_8.3p1 Ubuntu-1ubuntu0.1 pat OpenSSH* compat 0x04000000 debug1: Authenticating to data.neuro.polymtl.ca:22 as 'git' debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: algorithm: curve25519-sha256 debug1: kex: host key algorithm: ecdsa-sha2-nistp256 debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: compression: none debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: compression: none debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: Server host key: ecdsa-sha2-nistp256 SHA256:s8PdMunbOv9abtSQX8/tPW3VASKPl5jQ5hhki4Mt7wE debug1: Host 'data.neuro.polymtl.ca' is known and matches the ECDSA host key. debug1: Found key in /Users/julien/.ssh/known_hosts:35 debug1: rekey out after 134217728 blocks debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: rekey in after 134217728 blocks debug1: Will attempt key: /Users/julien/.ssh/id_rsa RSA SHA256:Ss3ePRjzwzjZAUYmqItooySyJdtd2UvlqbDZ5UaIAHo debug1: Will attempt key: /Users/julien/.ssh/id_dsa debug1: Will attempt key: /Users/julien/.ssh/id_ecdsa debug1: Will attempt key: /Users/julien/.ssh/id_ed25519 debug1: Will attempt key: /Users/julien/.ssh/id_xmss debug1: SSH2_MSG_EXT_INFO received debug1: kex_input_ext_info: server-sig-algs= debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey,password debug1: No more authentication methods to try. git@data.neuro.polymtl.ca: Permission denied (publickey,password). ```

Is it possible you simply never inscribed your macbook onto data.neuro?

i did already download several datasets on my laptop, so i'm not sure what changed since. Should i try to rename my .ssh/* files to recreate them? or edit them to remove one entry corresponding to the data server?

jcohenadad commented 2 years ago

ah! wait! i got it working. The solution is to do:

# data servers
Match Host data
HostName %h.neuro.polymtl.ca
User git
PreferredAuthentications publickey

instead of (advised in https://github.com/neuropoly/data-management/issues/154#issuecomment-983818916):

# data servers
Match Host data
HostName %h.neuro.polymtl.ca
User git
PreferredAuthentications pubkey

the neuropoly intranet does advise the correct thing though, so we're good 😅
thank you for your help!

jcohenadad commented 2 years ago

ah no, wait...

this works:

Terminal output ```console julien-macbook:~/data.neuro/basel-mp2rage $ ssh -v data OpenSSH_8.1p1, LibreSSL 2.7.3 debug1: Reading configuration data /Users/julien/.ssh/config debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 47: Applying options for * debug1: Connecting to data.neuro.polymtl.ca port 22. debug1: Connection established. debug1: identity file /Users/julien/.ssh/id_rsa type 0 debug1: identity file /Users/julien/.ssh/id_rsa-cert type -1 debug1: identity file /Users/julien/.ssh/id_dsa type -1 debug1: identity file /Users/julien/.ssh/id_dsa-cert type -1 debug1: identity file /Users/julien/.ssh/id_ecdsa type -1 debug1: identity file /Users/julien/.ssh/id_ecdsa-cert type -1 debug1: identity file /Users/julien/.ssh/id_ed25519 type -1 debug1: identity file /Users/julien/.ssh/id_ed25519-cert type -1 debug1: identity file /Users/julien/.ssh/id_xmss type -1 debug1: identity file /Users/julien/.ssh/id_xmss-cert type -1 debug1: Local version string SSH-2.0-OpenSSH_8.1 debug1: Remote protocol version 2.0, remote software version OpenSSH_8.3p1 Ubuntu-1ubuntu0.1 debug1: match: OpenSSH_8.3p1 Ubuntu-1ubuntu0.1 pat OpenSSH* compat 0x04000000 debug1: Authenticating to data.neuro.polymtl.ca:22 as 'git' debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: algorithm: curve25519-sha256 debug1: kex: host key algorithm: ecdsa-sha2-nistp256 debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: compression: none debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: compression: none debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: Server host key: ecdsa-sha2-nistp256 SHA256:s8PdMunbOv9abtSQX8/tPW3VASKPl5jQ5hhki4Mt7wE debug1: Host 'data.neuro.polymtl.ca' is known and matches the ECDSA host key. debug1: Found key in /Users/julien/.ssh/known_hosts:35 debug1: rekey out after 134217728 blocks debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: rekey in after 134217728 blocks debug1: Will attempt key: /Users/julien/.ssh/id_rsa RSA SHA256:Ss3ePRjzwzjZAUYmqItooySyJdtd2UvlqbDZ5UaIAHo debug1: Will attempt key: /Users/julien/.ssh/id_dsa debug1: Will attempt key: /Users/julien/.ssh/id_ecdsa debug1: Will attempt key: /Users/julien/.ssh/id_ed25519 debug1: Will attempt key: /Users/julien/.ssh/id_xmss debug1: SSH2_MSG_EXT_INFO received debug1: kex_input_ext_info: server-sig-algs= debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey,password debug1: Next authentication method: publickey debug1: Offering public key: /Users/julien/.ssh/id_rsa RSA SHA256:Ss3ePRjzwzjZAUYmqItooySyJdtd2UvlqbDZ5UaIAHo debug1: Server accepts key: /Users/julien/.ssh/id_rsa RSA SHA256:Ss3ePRjzwzjZAUYmqItooySyJdtd2UvlqbDZ5UaIAHo debug1: Authentication succeeded (publickey). Authenticated to data.neuro.polymtl.ca ([132.207.65.204]:22). debug1: channel 0: new [client-session] debug1: Requesting no-more-sessions@openssh.com debug1: Entering interactive session. debug1: pledge: network debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0 debug1: Remote: /srv/git/.ssh/authorized_keys:12: key options: command user-rc debug1: Remote: /srv/git/.ssh/authorized_keys:12: key options: command user-rc debug1: Sending environment. debug1: Sending env LANG = en_CA.UTF-8 PTY allocation request failed on channel 0 hello jcohen, this is git@data running gitolite3 3.6.11-2 (Debian) on git 2.27.0 R C datasets/..* R W datasets/basel-mp2rage R W datasets/data-single-subject_DO-NOT-USE R W datasets/data_axondeepseg_tem R W datasets/levin-stroke R W datasets/model_seg_exvivo_gm-wm_t2_unet2d-multichannel-softseg R W datasets/msseg_challenge_2016 R W datasets/msseg_challenge_2021 R W datasets/sci-colorado R W datasets/sci-zurich R W datasets/sct-testing-large R W datasets/spine-generic-processed R W datasets/uk-biobank R W datasets/uk-biobank-processed R W datasets/umass-ms-ge-excite1.5 R W datasets/umass-ms-ge-hdxt1.5 R W datasets/umass-ms-ge-pioneer3 R W datasets/umass-ms-siemens-espree1.5 R W datasets/wakehealth R W gitolite-admin Please see https://github.com/neuropoly/data-management/blob/master/internal-server.md for more help debug1: client_input_channel_req: channel 0 rtype exit-status reply 0 debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0 debug1: channel 0: free: client-session, nchannels 1 Connection to data.neuro.polymtl.ca closed. Transferred: sent 3820, received 3944 bytes, in 0.3 seconds Bytes per second: sent 15131.3, received 15622.5 debug1: Exit status 0 ```

but i still cannot update the dataset:

julien-macbook:~/data.neuro/basel-mp2rage $ git pull && git annex sync --no-content && git annex get .
git@data.neuro.polymtl.ca's password: 
Permission denied, please try again.
git@data.neuro.polymtl.ca's password: 
jcohenadad commented 2 years ago

i'll try to just erase and re-download a dataset?

EDIT: Actually, I cannot even do that (i get the permission error issue... :-( )

kousu commented 2 years ago

Have you rebooted lately by any chance?

jcohenadad commented 2 years ago

Have you rebooted lately by any chance?

Yes, I reboot my laptop every day. Same thing happened now (I checked again), at Poly (without the VPN).

kousu commented 2 years ago

@taowa figured out the missing piece! Thank you Taowa. Please take their advice, @jcohenadad.

You would have git clone git@data.neuro.polymtl.ca:....'d, while the test I asked you to do only tested ssh git@data, which fell through a different if-else tree.

I've updated the config on the wiki to cover both cases.