paramiko.ssh_exception.SSHException: No authentication methods available

Hi,
I am trying to set up a computer follow instruction in this webpages:
How to run external codes — AiiDA 2.5.1.post0 documentation
By verdi computer setup,i have set up set up supercomputer information.After verdi computer configure TRANSPORTTYPE COMPUTERLABEL,i have set up configures private connection details.
But when i verdi computer test COMPUTERNAME,

[FAILED]: Error while trying to connect to the computer
  Full traceback:
  Traceback (most recent call last):
    File "/usr/local/lib/python3.10/dist-packages/aiida/cmdline/commands/cmd_computer.py", line 546, in computer
      with transport:
    File "/usr/local/lib/python3.10/dist-packages/aiida/transports/transport.py", line 128, in __enter__
      self.open()
    File "/usr/local/lib/python3.10/dist-packages/aiida/transports/plugins/ssh.py", line 520, in open
      self._client.connect(self._machine, **connection_arguments)
    File "/usr/lib/python3/dist-packages/paramiko/client.py", line 435, in connect
      self._auth(
    File "/usr/lib/python3/dist-packages/paramiko/client.py", line 767, in _auth
      raise SSHException("No authentication methods available")
  paramiko.ssh_exception.SSHException: No authentication methods available
Warning: 1 out of 0 tests failed

appeared.
Any idea what the problem is?
Sincerely,
HaoXiang Wang
Student.
E-mail:332316010966@email.zzuli.edu.cn

It means AiiDA cannot open an SSH connection to your computer. Please share the output of verdi computer configure show COMPUTER (replacing COMPUTER with the label you gave to the computer). It will show the hostname that is defined. For this to work, you need to be able to SSH without AiiDA to that machine, using ssh {hostname}. If that doesn’t work, it is not a problem with AiiDA but a problem with your SSH configuration to the supercomputer.

Actually I am trying to log on the same remote HPC account and I am having the same problem.
This is my verdi computer show

(aiida_QE) yang@yang-Inspiron-3670:~/AiiDA/tutorial_plugin/diff$ verdi computer configure show a0s000508
* username               yang
* port                   22
* look_for_keys          False
* key_filename
* timeout                60
* allow_agent            True
* proxy_jump
* proxy_command
* compress               True
* gss_auth               False
* gss_kex                False
* gss_deleg_creds        False
* gss_host               ssh.cn-zhongwei-1.paracloud.com
* load_system_host_keys  True
* key_policy             RejectPolicy
* use_login_shell        True
* safe_interval          30.0

Here is my ssh successful login(There are some Chinese characters…)

(aiida_QE) yang@yang-Inspiron-3670:~/AiiDA/tutorial_plugin/diff$ ssh a0s000508@BSCC-A@ssh.cn-zhongwei-1.paracloud.com -p 22
Last login: Mon Feb 12 16:40:47 2024 from 10.255.128.13
+---------------------------------------------------------------------------------------------------------+
| 温馨提示:                                                                                              |
|    登录节点只能用来进行编辑编译工作,不能运行作业,管理员发现用户在登录节点提交程序,会杀掉相应作业,敬 |
| 请遵守规定!超算是独占节点形式,不满核提交将按照满核收费,建议尽量满核提交作业!                        |
|    amd_16core队列只支持单节点16核的作业,不支持其他核数,不支持跨节点。需要时请联系客服咨询脚本模板。   |
|    amd_test是调试队列,单节点64核256G内存,最多可以运行30分钟,计费标准与amd_256队列一致。              |
|                                                                                        超算云服务团队   |
|                                                                                        2020年5月28日    |
|                                                                                                         |
|                                                                                                         |
|                                                                                                         |
|   各位老师好,  为了提高用户使用体验,保障操作流畅性,10月9日起将取消A区public3上的module环境,登陆时不会|
| 自动加载,若有module需求:                                                                               |
|   public1用户可执行source /public1/soft/modules/module.sh                                               |
|   public3用户可执行source /public3/soft/modules/module.sh                                               |
|   public4用户可执行 source /public4/soft/modules/module.sh                                              |
|                                                                                                         |
|   public9用户可执行source /public9/soft/module.sh                                                       |
|  确认所使用的存储的方法:执行  pwd  即可查看。                                                          |
|                                                                                        超算云服务团队   |
|                                                                                        2020年10月9日    |
|                                                                                                         |
|   3月14日起,BSCC-A超算sacct单次查询历史作业详单的最长时间区间调整为30天,查询命令如下:
  sacct -D -T -X -u sc****  -S 2022-01-01T00:00:00 -E 2022-01-31T00:00:00
											 超算云服务团队
											 2022年3月8日
                                                                                                     |
|                                                                                                         |
|                                                                                                         |
|                                                                                                         |
|                                                                                                         |
|                                                                                                         |
+---------------------------------------------------------------------------------------------------------+
[a0s000508@ln23%bscc-a ~]$ 


And here is my computer test error information

(aiida_QE) yang@yang-Inspiron-3670:~/AiiDA/tutorial_plugin/diff$ verdi computer test a0s000508 --print-traceback
Report: Testing computer<a0s000508> for user<ygy11123@sina.com>...
* Opening connection... Error: Error connecting to 'ssh.cn-zhongwei-1.paracloud.com' through SSH: [SshTransport] Authentication failed., connect_args were: {'username': 'yang', 'port': 22, 'look_for_keys': False, 'key_filename': '', 'timeout': 60, 'allow_agent': True, 'proxy_jump': '', 'proxy_command': '', 'compress': True, 'gss_auth': False, 'gss_kex': False, 'gss_deleg_creds': False, 'gss_host': 'ssh.cn-zhongwei-1.paracloud.com'}
[FAILED]: Error while trying to connect to the computer
  Full traceback:
  Traceback (most recent call last):
    File "/home/yang/miniforge3/envs/aiida_QE/lib/python3.11/site-packages/aiida/cmdline/commands/cmd_computer.py", line 546, in computer_test
      with transport:
    File "/home/yang/miniforge3/envs/aiida_QE/lib/python3.11/site-packages/aiida/transports/transport.py", line 128, in __enter__
      self.open()
    File "/home/yang/miniforge3/envs/aiida_QE/lib/python3.11/site-packages/aiida/transports/plugins/ssh.py", line 520, in open
      self._client.connect(self._machine, **connection_arguments)
    File "/home/yang/miniforge3/envs/aiida_QE/lib/python3.11/site-packages/paramiko/client.py", line 450, in connect
      self._auth(
    File "/home/yang/miniforge3/envs/aiida_QE/lib/python3.11/site-packages/paramiko/client.py", line 781, in _auth
      raise saved_exception
    File "/home/yang/miniforge3/envs/aiida_QE/lib/python3.11/site-packages/paramiko/client.py", line 717, in _auth
      self._transport.auth_publickey(username, key)
    File "/home/yang/miniforge3/envs/aiida_QE/lib/python3.11/site-packages/paramiko/transport.py", line 1635, in auth_publickey
      return self.auth_handler.wait_for_response(my_event)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/yang/miniforge3/envs/aiida_QE/lib/python3.11/site-packages/paramiko/auth_handler.py", line 245, in wait_for_response
      raise e
  paramiko.ssh_exception.AuthenticationException: Authentication failed.
Warning: 1 out of 0 tests failed
(aiida_QE) 

Hope you can also help!

Sincerely,
Dr. Guoyu Yang
Lecturer
Jimei Univ, School of Science, Digital Fujian Big Data Modeling and Intelligent Computing Institute
185 Yinjiang Rd.,
Jimei District, Xiamen,361021
Fujian, China
E-mail: 201961000100@jmu.edu.cn

Two things I notice:

  • Using ssh you connect with the user a0s000508 but you configured the machine in AiiDA with yang. You should probably change that
  • You configured look_for_keys is False but also don’t specify an explicit key (key_filename is not set). I take it you are authenticating using a passwordless SSH key? You should set key_filename to the absolute filepath of that key

I changed the settings. It connects to the remote HPC, but fails at creating file test

* Creating and deleting temporary file... [Failed]: OSError: Error during mkdir of '/home/yang', maybe you don't have the permissions to do it, or the directory already exists? ([Errno 13] Permission denied)

It is making /home/yang at my local computer or remote HPC? Can I change the directory?
Here are the records

(aiida_QE) yang@yang-Inspiron-3670:~/AiiDA$  verdi -p quicksetup computer configure core.ssh a0s000508
Report: enter ? for help.
Report: enter ! to ignore the default and set no value.
User name [yang]: a0s000508@BSCC-A
Port number [22]: 
Look for keys [Y/n]: 
SSH key file []: /home/yang/.ssh/id_ed25519.pub
Connection timeout in s [60]: 
Allow ssh agent [Y/n]: 
SSH proxy jump []: 
SSH proxy command []: 
Compress file transfers [Y/n]: 
GSS auth [False]: 
GSS kex [False]: 
GSS deleg_creds [False]: 
GSS host [ssh.cn-zhongwei-1.paracloud.com]: 
Load system host keys [Y/n]: 
Key policy (RejectPolicy, WarningPolicy, AutoAddPolicy) [RejectPolicy]: WarningPolicy
Use login shell when executing command [Y/n]: 
Connection cooldown time (s) [30.0]: 
Report: Configuring computer a0s000508 for user ygy11123@sina.com.
Success: a0s000508 successfully configured for ygy11123@sina.com
(aiida_QE) yang@yang-Inspiron-3670:~/AiiDA$ verdi computer test a0s000508 --print-traceback
Report: Testing computer<a0s000508> for user<ygy11123@sina.com>...
* Opening connection... [OK]
* Checking for spurious output... [OK]
* Getting number of jobs from scheduler... [OK]: 0 jobs found in the queue
* Determining remote user name... [OK]: a0s000508
* Creating and deleting temporary file... [Failed]: OSError: Error during mkdir of '/home/yang', maybe you don't have the permissions to do it, or the directory already exists? ([Errno 13] Permission denied)
  Full traceback:
  Traceback (most recent call last):
    File "/home/yang/miniforge3/envs/aiida_QE/lib/python3.11/site-packages/aiida/cmdline/commands/cmd_computer.py", line 128, in _computer_create_temp_file
      transport.chdir(workdir)
    File "/home/yang/miniforge3/envs/aiida_QE/lib/python3.11/site-packages/aiida/transports/plugins/ssh.py", line 619, in chdir
      self.sftp.chdir(path)
    File "/home/yang/miniforge3/envs/aiida_QE/lib/python3.11/site-packages/paramiko/sftp_client.py", line 659, in chdir
      if not stat.S_ISDIR(self.stat(path).st_mode):
                          ^^^^^^^^^^^^^^^
    File "/home/yang/miniforge3/envs/aiida_QE/lib/python3.11/site-packages/paramiko/sftp_client.py", line 493, in stat
      t, msg = self._request(CMD_STAT, path)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/yang/miniforge3/envs/aiida_QE/lib/python3.11/site-packages/paramiko/sftp_client.py", line 822, in _request
      return self._read_response(num)
             ^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/yang/miniforge3/envs/aiida_QE/lib/python3.11/site-packages/paramiko/sftp_client.py", line 874, in _read_response
      self._convert_status(msg)
    File "/home/yang/miniforge3/envs/aiida_QE/lib/python3.11/site-packages/paramiko/sftp_client.py", line 903, in _convert_status
      raise IOError(errno.ENOENT, text)
  FileNotFoundError: [Errno 2] No such file
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/home/yang/miniforge3/envs/aiida_QE/lib/python3.11/site-packages/aiida/transports/plugins/ssh.py", line 737, in mkdir
      self.sftp.mkdir(path)
    File "/home/yang/miniforge3/envs/aiida_QE/lib/python3.11/site-packages/paramiko/sftp_client.py", line 460, in mkdir
      self._request(CMD_MKDIR, path, attr)
    File "/home/yang/miniforge3/envs/aiida_QE/lib/python3.11/site-packages/paramiko/sftp_client.py", line 822, in _request
      return self._read_response(num)
             ^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/yang/miniforge3/envs/aiida_QE/lib/python3.11/site-packages/paramiko/sftp_client.py", line 874, in _read_response
      self._convert_status(msg)
    File "/home/yang/miniforge3/envs/aiida_QE/lib/python3.11/site-packages/paramiko/sftp_client.py", line 905, in _convert_status
      raise IOError(errno.EACCES, text)
  PermissionError: [Errno 13] Permission denied
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/home/yang/miniforge3/envs/aiida_QE/lib/python3.11/site-packages/aiida/cmdline/commands/cmd_computer.py", line 558, in computer_test
      success, message = test(
                         ^^^^^
    File "/home/yang/miniforge3/envs/aiida_QE/lib/python3.11/site-packages/aiida/cmdline/commands/cmd_computer.py", line 130, in _computer_create_temp_file
      transport.makedirs(workdir)
    File "/home/yang/miniforge3/envs/aiida_QE/lib/python3.11/site-packages/aiida/transports/plugins/ssh.py", line 721, in makedirs
      self.mkdir(this_dir)
    File "/home/yang/miniforge3/envs/aiida_QE/lib/python3.11/site-packages/aiida/transports/plugins/ssh.py", line 740, in mkdir
      raise OSError(
  OSError: Error during mkdir of '/home/yang', maybe you don't have the permissions to do it, or the directory already exists? ([Errno 13] Permission denied)
* Checking for possible delay from using login shell... [OK]
Warning: 1 out of 6 tests failed
(aiida_QE) yang@yang-Inspiron-3670:~/AiiDA$ verdi computer configure show
Usage: verdi computer configure show [OPTIONS] COMPUTER
Try 'verdi computer configure show --help' for help.

Error: Missing argument 'COMPUTER'.
(aiida_QE) yang@yang-Inspiron-3670:~/AiiDA$ verdi computer configure show  a0s000508
* username               a0s000508@BSCC-A
* port                   22
* look_for_keys          True
* key_filename           /home/yang/.ssh/id_ed25519.pub
* timeout                60
* allow_agent            True
* proxy_jump
* proxy_command
* compress               True
* gss_auth               False
* gss_kex                False
* gss_deleg_creds        False
* gss_host               ssh.cn-zhongwei-1.paracloud.com
* load_system_host_keys  True
* key_policy             WarningPolicy
* use_login_shell        True
* safe_interval          30.0
(aiida_QE) yang@yang-Inspiron-3670:~/AiiDA$ vi /home/yang/.ssh/id_ed25519.pub

Sincerely,
Dr. Guoyu Yang
Lecturer
Jimei Univ, School of Science, Digital Fujian Big Data Modeling and Intelligent Computing Institute
185 Yinjiang Rd.,
Jimei District, Xiamen,361021
Fujian, China
E-mail: 201961000100@jmu.edu.cn

The test is trying to create a file on the remote. It is doing this in the working directory that you defined during verdi computer setup. Apparently you set this to /home/yang (you can verify with verdi computer show) and it either doesn’t exist or it doesn’t have the correct permissions. You should set this work_dir during verdi computer setup to a folder where calculations can run. Like a scratch space.

Finally succeed

(aiida_QE) yang@yang-Inspiron-3670:~/AiiDA/tutorial_performance$ verdi computer  duplicate a0s000508
Report: enter ? for help.
Report: enter ! to ignore the default and set no value.
Computer label [a0s000508]: a0s000508_02
Hostname [ssh.cn-zhongwei-1.paracloud.com]: 
Description [shared]: 
Transport plugin [core.ssh]: 
Scheduler plugin [core.slurm]: 
Shebang line (first line of each script, starting with #!) [#!/bin/bash]: 
Work directory on the computer [/home/yang/AiiDA/tutorial_ssh/01_a0s000508]: /public4/home/a0s000508/AiiDA_local/AiiDA_local_01
Mpirun command [srun -n {tot_num_mpiprocs}]: srun -n {tot_num_mpiprocs}
Default number of CPUs per machine [64]: 
Default amount of memory per machine (kB). [268435456]: 
Success: stored computer a0s000508_02<None>
Success: Computer<5> a0s000508_02 created
Report: Note: before the computer can be used, it has to be configured with the command:
Report:   verdi -p quicksetup computer configure core.ssh a0s000508_02
(aiida_QE) yang@yang-Inspiron-3670:~/AiiDA/tutorial_performance$ verdi computer show a0s000508_02
---------------------------  --------------------------------------------------
Label                        a0s000508_02
PK                           5
UUID                         0febb5fc-213e-4c8e-b531-fa8927a10dac
Description                  shared
Hostname                     ssh.cn-zhongwei-1.paracloud.com
Transport type               core.ssh
Scheduler type               core.slurm
Work directory               /public4/home/a0s000508/AiiDA_local/AiiDA_local_01
Shebang                      #!/bin/bash
Mpirun command               srun -n {tot_num_mpiprocs}
Default #procs/machine       64
Default memory (kB)/machine  268435456
Prepend text
Append text
---------------------------  --------------------------------------------------
(aiida_QE) yang@yang-Inspiron-3670:~/AiiDA/tutorial_performance$ verdi computer  duplicate a0s000508
Report: enter ? for help.
Report: enter ! to ignore the default and set no value.
Computer label [a0s000508]: a0s000508_03
Hostname [ssh.cn-zhongwei-1.paracloud.com]: 
Description [shared]: 
Transport plugin [core.ssh]: 
Scheduler plugin [core.slurm]: 
Shebang line (first line of each script, starting with #!) [#!/bin/bash]: 
Work directory on the computer [/home/yang/AiiDA/tutorial_ssh/01_a0s000508]: /public4/home/a0s000508/AiiDA_local/AiiDA_local_01
Mpirun command [srun -n {tot_num_mpiprocs}]: 
Default number of CPUs per machine [64]: 
Default amount of memory per machine (kB). [268435456]: 
Success: stored computer a0s000508_03<None>
Success: Computer<6> a0s000508_03 created
Report: Note: before the computer can be used, it has to be configured with the command:
Report:   verdi -p quicksetup computer configure core.ssh a0s000508_03
(aiida_QE) yang@yang-Inspiron-3670:~/AiiDA/tutorial_performance$ verdi computer show a0s000508_03
---------------------------  ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Label                        a0s000508_03
PK                           6
UUID                         5cccbf94-6582-46a3-af21-b7f14c7441c9
Description                  shared
Hostname                     ssh.cn-zhongwei-1.paracloud.com
Transport type               core.ssh
Scheduler type               core.slurm
Work directory               /public4/home/a0s000508/AiiDA_local/AiiDA_local_01
Shebang                      #!/bin/bash
Mpirun command               srun -n {tot_num_mpiprocs}
Default #procs/machine       64
Default memory (kB)/machine  268435456
Prepend text                 #SBATCH -p amd_256
                             #SBATCH -N 1
                             #SBATCH -n 64
                             source /public4/soft/modules/module.sh
                             module load lapack/3.9.0-wxl-public4 fftw/3.3.8-mpi-public4 netcdf/4.4.1-parallel-icc17-ls-public4 libxc/4.3.4-icc17-ls-public4  szip/2.1.1-wzm-public4  blas/3.8.0-public4
                             export PATH=/public4/home/a0s000508/software-a0s000508/qe-7.3/qe-install/bin:$PATH
Append text
---------------------------  ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
(aiida_QE) yang@yang-Inspiron-3670:~/AiiDA/tutorial_performance$ verdi -p quicksetup computer configure core.ssh a0s000508_03
Report: enter ? for help.
Report: enter ! to ignore the default and set no value.
User name [yang]: 
Port number [22]: ^CAborted!
(aiida_QE) yang@yang-Inspiron-3670:~/AiiDA/tutorial_performance$ verdi -p quicksetup computer configure core.ssh a0s000508_03
Report: enter ? for help.
Report: enter ! to ignore the default and set no value.
User name [yang]: a0s000508@BSCC-A
Port number [22]: 
Look for keys [Y/n]: 
SSH key file []: /home/yang/.ssh/id_ed25519.pub
Connection timeout in s [60]: 
Allow ssh agent [Y/n]: 
SSH proxy jump []: 
SSH proxy command []: 
Compress file transfers [Y/n]: 
GSS auth [False]: 
GSS kex [False]: 
GSS deleg_creds [False]: 
GSS host [ssh.cn-zhongwei-1.paracloud.com]: 
Load system host keys [Y/n]: 
Key policy (RejectPolicy, WarningPolicy, AutoAddPolicy) [RejectPolicy]: WarningPolicy
Use login shell when executing command [Y/n]: 
Connection cooldown time (s) [30.0]: 
Report: Configuring computer a0s000508_03 for user ygy11123@sina.com.
Success: a0s000508_03 successfully configured for ygy11123@sina.com
(aiida_QE) yang@yang-Inspiron-3670:~/AiiDA/tutorial_performance$ verdi computer test a0s000508_03 --print-traceback
Report: Testing computer<a0s000508_03> for user<ygy11123@sina.com>...
* Opening connection... [OK]
* Checking for spurious output... [OK]
* Getting number of jobs from scheduler... [OK]: 0 jobs found in the queue
* Determining remote user name... [OK]: a0s000508
* Creating and deleting temporary file... [OK]
* Checking for possible delay from using login shell... [OK]
Success: all 6 tests succeeded
(aiida_QE) yang@yang-Inspiron-3670:~/AiiDA/tutorial_performance$ verdi computer show a0s000508_03
---------------------------  ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Label                        a0s000508_03
PK                           6
UUID                         5cccbf94-6582-46a3-af21-b7f14c7441c9
Description                  shared
Hostname                     ssh.cn-zhongwei-1.paracloud.com
Transport type               core.ssh
Scheduler type               core.slurm
Work directory               /public4/home/a0s000508/AiiDA_local/AiiDA_local_01
Shebang                      #!/bin/bash
Mpirun command               srun -n {tot_num_mpiprocs}
Default #procs/machine       64
Default memory (kB)/machine  268435456
Prepend text                 #SBATCH -p amd_256
                             #SBATCH -N 1
                             #SBATCH -n 64
                             source /public4/soft/modules/module.sh
                             module load lapack/3.9.0-wxl-public4 fftw/3.3.8-mpi-public4 netcdf/4.4.1-parallel-icc17-ls-public4 libxc/4.3.4-icc17-ls-public4  szip/2.1.1-wzm-public4  blas/3.8.0-public4
                             export PATH=/public4/home/a0s000508/software-a0s000508/qe-7.3/qe-install/bin:$PATH
Append text
---------------------------  ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
(aiida_QE) yang@yang-Inspiron-3670:~/AiiDA/tutorial_performance$ verdi computer configure show  a0s000508_03
* username               a0s000508@BSCC-A
* port                   22
* look_for_keys          True
* key_filename           /home/yang/.ssh/id_ed25519.pub
* timeout                60
* allow_agent            True
* proxy_jump
* proxy_command
* compress               True
* gss_auth               False
* gss_kex                False
* gss_deleg_creds        False
* gss_host               ssh.cn-zhongwei-1.paracloud.com
* load_system_host_keys  True
* key_policy             WarningPolicy
* use_login_shell        True
* safe_interval          30.0
(aiida_QE) yang@yang-Inspiron-3670:~/AiiDA/tutorial_performance$ 

But I have another question, can I change Prepend text Work directory and so on after setup the computer, or I need to duplicate or setup a new computer ?

Many thanks!

Sincerely,
Dr. Guoyu Yang
Lecturer
Jimei Univ, School of Science, Digital Fujian Big Data Modeling and Intelligent Computing Institute
185 Yinjiang Rd.,
Jimei District, Xiamen,361021
Fujian, China
E-mail: 201961000100@jmu.edu.cn

Glad it worked. You can use verdi computer duplicate to create a clone. It will work like verdi computer setup but all prompt defaults are already prefilled from your existing computer. Then you can simply accept all defaults and just change the properties you want to change. Alternatively, you can always just verdi computer delete and verdi computer setup again.