ReproNim / reproman

ReproMan (AKA NICEMAN, AKA ReproNim TRD3)
https://reproman.readthedocs.io
Other
24 stars 14 forks source link

can no longer login to fresh ec2 : key cannot be used for signing #563

Open yarikoptic opened 3 years ago

yarikoptic commented 3 years ago

I believe such workflow was working fine before but no longer :-/

$> reproman create -t aws-ec2 my-nitrc-quick -b instance_type=t2.medium  -b key_name=my-nitrc      
2020-12-14 21:52:00,246 [INFO   ] Waiting for EC2 instance i-031cfd2f416c24ddc to start running... 
2020-12-14 21:52:45,842 [INFO   ] EC2 instance i-031cfd2f416c24ddc is running! 
2020-12-14 21:52:45,842 [INFO   ] Waiting for EC2 instance i-031cfd2f416c24ddc to complete initialization... 
2020-12-14 21:55:32,412 [INFO   ] EC2 instance i-031cfd2f416c24ddc initialized! 
2020-12-14 21:55:32,434 [INFO   ] Created the environment my-nitrc-quick 
(dev3) 1 44265.....................................:Mon 14 Dec 2020 09:55:32 PM EST:.
(git)lena:~/proj/repronim/reproman[master]git
$> reproman -l debug login my-nitrc-quick                                           
2020-12-14 21:58:09,526 [DEBUG  ] SSH connecting to ubuntu@3.227.208.24:22, authenticating with SSH config 
Exception: key cannot be used for signing
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/paramiko/transport.py", line 2109, in run
    handler(self.auth_handler, m)
  File "/usr/lib/python3/dist-packages/paramiko/auth_handler.py", line 298, in _parse_service_accept
    sig = self.private_key.sign_ssh_data(blob)
  File "/usr/lib/python3/dist-packages/paramiko/agent.py", line 418, in sign_ssh_data
    raise SSHException("key cannot be used for signing")
paramiko.ssh_exception.SSHException: key cannot be used for signing

Password for my-nitrc-quick: 

originally such an error message was seen in https://github.com/ReproNim/reproman/issues/480 but in connection to kerberos login. But may be kerberos was a red-hairing and unrelated?

or may be it is because I decided to reuse prior key from another instance (provided -b key_name?

edit 1

was able to login with straight ssh ```shell $> ssh -i /home/yoh/.local/share/reproman/ec2_keys/my-nitrc.pem ubuntu@3.227.208.24 load pubkey "/home/yoh/.local/share/reproman/ec2_keys/my-nitrc.pem": invalid format The authenticity of host '3.227.208.24 (3.227.208.24)' can't be established. ECDSA key fingerprint is SHA256:C6VAjNIUB3ynF/ma89+op0vFEFfY945m595RLq+hTfg. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added '3.227.208.24' (ECDSA) to the list of known hosts. Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-100-generic x86_64) * Documentation: https://help.ubuntu.com/ System information as of Tue Dec 15 02:52:50 UTC 2020 System load: 0.0 Memory usage: 1% Processes: 88 Usage of /: 10.1% of 7.74GB Swap usage: 0% Users logged in: 0 Graph this data and manage this system at: https://landscape.canonical.com/ Get cloud support with Ubuntu Advantage Cloud Guest: http://www.ubuntu.com/business/services/cloud 0 packages can be updated. 0 updates are security updates. The programs included with the Ubuntu system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. ```

so seems some paramiko gotcha... yet another reason for #560 RF

yarikoptic commented 3 years ago

I believe it was just that key_filename was None.