Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. SSH Connection with Remote Linux devices
Forum Updated to NodeBB v4.3 + New Features

SSH Connection with Remote Linux devices

Scheduled Pinned Locked Moved Unsolved General and Desktop
28 Posts 4 Posters 6.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J JonB
    20 Jan 2024, 13:42

    @Vijaykarthikeyan said in SSH Connection with Remote Linux devices:

    why?it is not printing..readAllStandardOutput and readAllStandardError

    As I presume you have discovered, you will not receive any output from a subprocess if you ask for it immediately after starting it --- no output has yet been produced. You either need to connect() to readyRead.,.,.(), call waitForReadyRead() (yuck!) or wait until process finished.

    But,when i give the command to navigate to the file directory it says too many arguments

    For people to help you, don't you think we need to see what "command" you are issuing, how you are issuing it, and just what the error message reads? Or do you think we can tell you what is wrong with your "command to navigate to the file directory" without knowing what you have done?

    V Offline
    V Offline
    Vijaykarthikeyan
    wrote on 22 Jan 2024, 05:30 last edited by
    #21

    @JonB go through my preivous replies,i have already quoted this signal slot mechanism..please read that too..and @jsulm already corrected me for using corrrect signal and slot..

    1 Reply Last reply
    0
    • J JonB
      20 Jan 2024, 13:42

      @Vijaykarthikeyan said in SSH Connection with Remote Linux devices:

      why?it is not printing..readAllStandardOutput and readAllStandardError

      As I presume you have discovered, you will not receive any output from a subprocess if you ask for it immediately after starting it --- no output has yet been produced. You either need to connect() to readyRead.,.,.(), call waitForReadyRead() (yuck!) or wait until process finished.

      But,when i give the command to navigate to the file directory it says too many arguments

      For people to help you, don't you think we need to see what "command" you are issuing, how you are issuing it, and just what the error message reads? Or do you think we can tell you what is wrong with your "command to navigate to the file directory" without knowing what you have done?

      V Offline
      V Offline
      Vijaykarthikeyan
      wrote on 22 Jan 2024, 05:33 last edited by
      #22

      @JonB Please go through my code snippet which i have been already included what is the command line which im trying to pass. And I seek what is the mistake which I have been done.Ok...Do you think the people who are asking doubt are just not knowing anything at all? All these people in this conversation..gone through the snippet and corrects me in each comment

      J 1 Reply Last reply 22 Jan 2024, 14:54
      0
      • V Vijaykarthikeyan
        22 Jan 2024, 05:33

        @JonB Please go through my code snippet which i have been already included what is the command line which im trying to pass. And I seek what is the mistake which I have been done.Ok...Do you think the people who are asking doubt are just not knowing anything at all? All these people in this conversation..gone through the snippet and corrects me in each comment

        J Online
        J Online
        JonB
        wrote on 22 Jan 2024, 14:54 last edited by
        #23

        @Vijaykarthikeyan

        But,when i give the command to navigate to the file directory it says too many arguments

        Evidently the other people understand what you are passing to QProcess, how you are specifying arguments, etc.. I don't. So you can wait for them.

        V 1 Reply Last reply 25 Jan 2024, 12:50
        0
        • J JonB
          22 Jan 2024, 14:54

          @Vijaykarthikeyan

          But,when i give the command to navigate to the file directory it says too many arguments

          Evidently the other people understand what you are passing to QProcess, how you are specifying arguments, etc.. I don't. So you can wait for them.

          V Offline
          V Offline
          Vijaykarthikeyan
          wrote on 25 Jan 2024, 12:50 last edited by
          #24

          @JonB there is a screenshot of command prompt of what i want to give..It's in the very 1st place of my questionn.I think your eyes cheated you

          J 1 Reply Last reply 25 Jan 2024, 13:44
          0
          • V Vijaykarthikeyan
            25 Jan 2024, 12:50

            @JonB there is a screenshot of command prompt of what i want to give..It's in the very 1st place of my questionn.I think your eyes cheated you

            J Online
            J Online
            JonB
            wrote on 25 Jan 2024, 13:44 last edited by JonB
            #25

            @Vijaykarthikeyan
            But firstly you say you have "changed" what you are issuing at some point, and secondly your screenshot shows you issuing a command of .ROV.sh which gives message python: no process found. This hardly seems an ideal place to start from, to me.

            Then The only QProcess (assuming that is what sshProcess is) statement you show executes the following:

            ssh -T ssh "username@host" "password" "cd Desktop && ./ROV.sh"
            

            I am not an ssh expert. But is it really right that you want to execute ssh ... ssh ...??

            Then you say there is no documentation for how to pass arguments to ssh, which is not its job to document. Or their "format", which is not its job either.

            Then you seem to say you have "changed" what you do, but I don't know how, and then that it's "working".

            Then you say

            But,when i give the command to navigate to the file directory it says too many arguments

            But rather then telling us what exactly you pass to QProcess you say we should look at screenshots and it is our fault for failing to understand.

            Then you tell me that other people can answer your questions but not me, so I suggest you wait for them to understand what I do not.

            Here is what I would have expected/hoped for from you, and from myself if I were asking the question:

            1. I have tried a single-line ssh from a terminal outside of Qt. Here is the verbatim of what I typed:
            ssh ...
            
            1. And here is how I tried to call that with QProcess:
            sshArgs << ...
            sshProcess->start("ssh", sshArgs);
            

            and here is the output or error message or behaviour or whatever is wrong.

            And it it were me I would expect to start with a command no more than, like, echo hello, verify that works first, then move onto cding and running a .sh.

            If I am not able to give the help you want, that's fine, and if you find others understand better and you'd rather await their responses, that's fine too. But please don't belabour me for failing to know just what you are doing from your screenshots when it would take you a few seconds to provide answers to points 1. & 2. per my request instead of saying I should be able to answer without further clarification.

            V 1 Reply Last reply 29 Jan 2024, 05:43
            1
            • J JonB
              25 Jan 2024, 13:44

              @Vijaykarthikeyan
              But firstly you say you have "changed" what you are issuing at some point, and secondly your screenshot shows you issuing a command of .ROV.sh which gives message python: no process found. This hardly seems an ideal place to start from, to me.

              Then The only QProcess (assuming that is what sshProcess is) statement you show executes the following:

              ssh -T ssh "username@host" "password" "cd Desktop && ./ROV.sh"
              

              I am not an ssh expert. But is it really right that you want to execute ssh ... ssh ...??

              Then you say there is no documentation for how to pass arguments to ssh, which is not its job to document. Or their "format", which is not its job either.

              Then you seem to say you have "changed" what you do, but I don't know how, and then that it's "working".

              Then you say

              But,when i give the command to navigate to the file directory it says too many arguments

              But rather then telling us what exactly you pass to QProcess you say we should look at screenshots and it is our fault for failing to understand.

              Then you tell me that other people can answer your questions but not me, so I suggest you wait for them to understand what I do not.

              Here is what I would have expected/hoped for from you, and from myself if I were asking the question:

              1. I have tried a single-line ssh from a terminal outside of Qt. Here is the verbatim of what I typed:
              ssh ...
              
              1. And here is how I tried to call that with QProcess:
              sshArgs << ...
              sshProcess->start("ssh", sshArgs);
              

              and here is the output or error message or behaviour or whatever is wrong.

              And it it were me I would expect to start with a command no more than, like, echo hello, verify that works first, then move onto cding and running a .sh.

              If I am not able to give the help you want, that's fine, and if you find others understand better and you'd rather await their responses, that's fine too. But please don't belabour me for failing to know just what you are doing from your screenshots when it would take you a few seconds to provide answers to points 1. & 2. per my request instead of saying I should be able to answer without further clarification.

              V Offline
              V Offline
              Vijaykarthikeyan
              wrote on 29 Jan 2024, 05:43 last edited by
              #26

              @JonB I have said everything at the question..Now,I'm telling you again.

              I have a .sh(shell script) file which is in the current directory of the desktop.the desktop path is in the Linux device.(I'm using Raspberry pi.So,it works in Linux OS).

              So,the path will look like this:

              Desktop->(current Directory)->ROV.sh file

              This should be executed by Qt through ssh.For that,I have used QProcess.This is what exactly I'm trying to do and I don't want to acheive it through TCP connection or socket connection libraries.

              This is what I want and what I'm trying to say.

              As I have already said When running the command:
              Screenshot 2024-01-19 145826.png

              is working correctly.And you have mentioned there's a message called Python: no process found. Don't give attention to that.It's a starting message like a test message to check whether the file is working or not.So,don't take that as serious.

              you said my doubt is changing sequentially.Actually,I'm parallely searching for the answers in other forum like to change password settings and all and @jsulm guided me to go for key pair authentification rather than typing password.

              According to you ,if i belaboured you, then what about this:

              (yuck!) or wait until process finished

              this is the thing you too belaboured me from the very 1st conversation..I have quoted all the problem statements at the time of asking questions,given the code snippet of mine,shown the screenshot. told what exactly what i want to do,told what is the problem I'm facing. All I have given you, atlast you have belaboured me.

              So,It's you who is belabouring

              J 1 Reply Last reply 29 Jan 2024, 10:56
              0
              • V Vijaykarthikeyan
                29 Jan 2024, 05:43

                @JonB I have said everything at the question..Now,I'm telling you again.

                I have a .sh(shell script) file which is in the current directory of the desktop.the desktop path is in the Linux device.(I'm using Raspberry pi.So,it works in Linux OS).

                So,the path will look like this:

                Desktop->(current Directory)->ROV.sh file

                This should be executed by Qt through ssh.For that,I have used QProcess.This is what exactly I'm trying to do and I don't want to acheive it through TCP connection or socket connection libraries.

                This is what I want and what I'm trying to say.

                As I have already said When running the command:
                Screenshot 2024-01-19 145826.png

                is working correctly.And you have mentioned there's a message called Python: no process found. Don't give attention to that.It's a starting message like a test message to check whether the file is working or not.So,don't take that as serious.

                you said my doubt is changing sequentially.Actually,I'm parallely searching for the answers in other forum like to change password settings and all and @jsulm guided me to go for key pair authentification rather than typing password.

                According to you ,if i belaboured you, then what about this:

                (yuck!) or wait until process finished

                this is the thing you too belaboured me from the very 1st conversation..I have quoted all the problem statements at the time of asking questions,given the code snippet of mine,shown the screenshot. told what exactly what i want to do,told what is the problem I'm facing. All I have given you, atlast you have belaboured me.

                So,It's you who is belabouring

                J Online
                J Online
                JonB
                wrote on 29 Jan 2024, 10:56 last edited by
                #27

                @Vijaykarthikeyan Bye.

                V 1 Reply Last reply 29 Jan 2024, 11:18
                0
                • J JonB
                  29 Jan 2024, 10:56

                  @Vijaykarthikeyan Bye.

                  V Offline
                  V Offline
                  Vijaykarthikeyan
                  wrote on 29 Jan 2024, 11:18 last edited by
                  #28

                  @JonB what

                  1 Reply Last reply
                  0

                  21/28

                  22 Jan 2024, 05:30

                  • Login

                  • Login or register to search.
                  21 out of 28
                  • First post
                    21/28
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved