SSH password transmission



  • I need to do teams on the remote server. To this end, a team is calling:

     ssh root@ip 'echo 123'
    

    It'd be all right, but I have to pass the password to the same team. It's necessary to use this team in Qt because of qt, I can't catch the password request and introduce it.

    system("ssh root@" TARGET_IP " 'echo 123'");
    

    Where to dig?


    The key's on the server, but the Qt team. system("ssh root@" TARGET_IP " 'echo 123'"); Makes such mistakes:

    ssh_askpass: exec(/usr/libexec/ssh-askpass): No such file or directory
    ssh_askpass: exec(/usr/libexec/ssh-askpass): No such file or directory
    ssh_askpass: exec(/usr/libexec/ssh-askpass): No such file or directory
    ssh_askpass: exec(/usr/libexec/ssh-askpass): No such file or directory
    Received disconnect from 192.168.5.161: 2: Too many authentication failures
    Disconnected from 192.168.5.161


    To the team. root@ip 'echo 123' He asks the password anyway. The key lies in the derictor. /root/.ssh



  • On the server, any editor, vim /etc/ssh/sshd_config

      RSAAuthentication yes
      PasswordAuthentication no /указать NO
       HostKey /root/.ssh/rsa_key.pub  /указать путь к ключу
    



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2