ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Timeout in .sh file

    IT Discussion
    5
    50
    2.7k
    Loading More Posts
    • 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.
    • LakshmanaL
      Lakshmana @thwr
      last edited by

      @thwr said in Timeout in .sh file:

      I would always use curl / wget / any other CLI tool before I would use Chromium (Chromium != Chrome) for a simple file download. It's a monster in terms of resource consumption.

      I tried wget where credentials is asking and in curl the file is not downloading where the test file created inside that file the link is there to download the file.So only using Chrome here

      scottalanmillerS stacksofplatesS 2 Replies Last reply Reply Quote 0
      • LakshmanaL
        Lakshmana @black3dynamite
        last edited by

        @black3dynamite said in Timeout in .sh file:

        @lakshmana said in Timeout in .sh file:

        @scottalanmiller said in Timeout in .sh file:

        @lakshmana said in Timeout in .sh file:

        @scottalanmiller said in Timeout in .sh file:

        @lakshmana said in Timeout in .sh file:

        @scottalanmiller

        @lakshmana said in Timeout in .sh file:

        @black3dynamite said in Timeout in .sh file:

        pkill chromium

        https://www.garron.me/en/bits/kill-all-instances-chromium-linux-command-line.html

        While using the chrome is not even starting but the working chrome is being killed

        We can use but need to give credentials.I need to run without admin credentials

        You can do that with cURL for sure, and I expect wget.

        During using Curl the file is not downloading where the link for that file is created inside the downloaded file

        Are you sending the credentials with cURL?

        How to do this?

        https://www.cyberciti.biz/faq/curl-download-file-example-under-linux-unix/
        curl http://username:[email protected]/file/path/data.tar.gz
        or
        curl -u Username:Password http://server1.cyberciti.biz/file/path/data.tar.gz

        This .sh file will be running in my colleague System also at that time credentials cannot be shown right! So only going for Chrome

        thwrT 1 Reply Last reply Reply Quote 0
        • thwrT
          thwr @Lakshmana
          last edited by thwr

          @lakshmana said in Timeout in .sh file:

          @black3dynamite said in Timeout in .sh file:

          @lakshmana said in Timeout in .sh file:

          @scottalanmiller said in Timeout in .sh file:

          @lakshmana said in Timeout in .sh file:

          @scottalanmiller said in Timeout in .sh file:

          @lakshmana said in Timeout in .sh file:

          @scottalanmiller

          @lakshmana said in Timeout in .sh file:

          @black3dynamite said in Timeout in .sh file:

          pkill chromium

          https://www.garron.me/en/bits/kill-all-instances-chromium-linux-command-line.html

          While using the chrome is not even starting but the working chrome is being killed

          We can use but need to give credentials.I need to run without admin credentials

          You can do that with cURL for sure, and I expect wget.

          During using Curl the file is not downloading where the link for that file is created inside the downloaded file

          Are you sending the credentials with cURL?

          How to do this?

          https://www.cyberciti.biz/faq/curl-download-file-example-under-linux-unix/
          curl http://username:[email protected]/file/path/data.tar.gz
          or
          curl -u Username:Password http://server1.cyberciti.biz/file/path/data.tar.gz

          This .sh file will be running in my colleague System also at that time credentials cannot be shown right! So only going for Chrome

          There are still better ways. Read the password from a file that can only be read by the user which is invoking the download process. You could pass credentials from stdin or simply use curl's --netrc-file parameter:

          curl [your options here] --netrc-file /your/secret/and/not/world/readable/password-file http://some.link/to/the/file
          

          The password file looks like this:

          machine <example.com> login <username> password <password>
          

          See here for more information: https://stackoverflow.com/a/27894407

          I could even think about a encrypted password stored in a file that will be decrypted on the fly using stdin passing - but that's way more advanced stuff.

          1 Reply Last reply Reply Quote 0
          • scottalanmillerS
            scottalanmiller @Lakshmana
            last edited by

            @lakshmana said in Timeout in .sh file:

            @thwr said in Timeout in .sh file:

            I would always use curl / wget / any other CLI tool before I would use Chromium (Chromium != Chrome) for a simple file download. It's a monster in terms of resource consumption.

            I tried wget where credentials is asking and in curl the file is not downloading where the test file created inside that file the link is there to download the file.So only using Chrome here

            Just because you tried and didn't figure it out doesn't mean it isn't the right solution. You don't have anything working right now, or you'd not need the question. We are trying to get this working in a practical, logical way, and cURL is almost certainly the right way.

            LakshmanaL 1 Reply Last reply Reply Quote 1
            • LakshmanaL
              Lakshmana @scottalanmiller
              last edited by

              @scottalanmiller said in Timeout in .sh file:

              @lakshmana said in Timeout in .sh file:

              @thwr said in Timeout in .sh file:

              I would always use curl / wget / any other CLI tool before I would use Chromium (Chromium != Chrome) for a simple file download. It's a monster in terms of resource consumption.

              I tried wget where credentials is asking and in curl the file is not downloading where the test file created inside that file the link is there to download the file.So only using Chrome here

              Just because you tried and didn't figure it out doesn't mean it isn't the right solution. You don't have anything working right now, or you'd not need the question. We are trying to get this working in a practical, logical way, and cURL is almost certainly the right way.

              Yes I understood but trying my efforts

              1 Reply Last reply Reply Quote 0
              • stacksofplatesS
                stacksofplates @Lakshmana
                last edited by

                @lakshmana said in Timeout in .sh file:

                @thwr said in Timeout in .sh file:

                I would always use curl / wget / any other CLI tool before I would use Chromium (Chromium != Chrome) for a simple file download. It's a monster in terms of resource consumption.

                I tried wget where credentials is asking and in curl the file is not downloading where the test file created inside that file the link is there to download the file.So only using Chrome here

                Show us the command you ran. I have a feeling you’re either not following a redirect or your output option is not set correctly.

                LakshmanaL 1 Reply Last reply Reply Quote 1
                • LakshmanaL
                  Lakshmana @stacksofplates
                  last edited by

                  @stacksofplates said in Timeout in .sh file:

                  @lakshmana said in Timeout in .sh file:

                  @thwr said in Timeout in .sh file:

                  I would always use curl / wget / any other CLI tool before I would use Chromium (Chromium != Chrome) for a simple file download. It's a monster in terms of resource consumption.

                  I tried wget where credentials is asking and in curl the file is not downloading where the test file created inside that file the link is there to download the file.So only using Chrome here

                  Show us the command you ran. I have a feeling you’re either not following a redirect or your output option is not set correctly.

                  curl -o "Link"

                  thwrT scottalanmillerS 2 Replies Last reply Reply Quote 0
                  • thwrT
                    thwr @Lakshmana
                    last edited by

                    @lakshmana said in Timeout in .sh file:

                    @stacksofplates said in Timeout in .sh file:

                    @lakshmana said in Timeout in .sh file:

                    @thwr said in Timeout in .sh file:

                    I would always use curl / wget / any other CLI tool before I would use Chromium (Chromium != Chrome) for a simple file download. It's a monster in terms of resource consumption.

                    I tried wget where credentials is asking and in curl the file is not downloading where the test file created inside that file the link is there to download the file.So only using Chrome here

                    Show us the command you ran. I have a feeling you’re either not following a redirect or your output option is not set correctly.

                    curl -o "Link"

                    Could you please try what I posted above? And could you please bring some light in your requirements? What kind of authentication is required by the server? Basic HTTP Auth?

                    LakshmanaL 1 Reply Last reply Reply Quote 0
                    • LakshmanaL
                      Lakshmana @thwr
                      last edited by Lakshmana

                      @thwr

                      @thwr said in Timeout in .sh file:

                      @lakshmana said in Timeout in .sh file:

                      @stacksofplates said in Timeout in .sh file:

                      @lakshmana said in Timeout in .sh file:

                      @thwr said in Timeout in .sh file:

                      I would always use curl / wget / any other CLI tool before I would use Chromium (Chromium != Chrome) for a simple file download. It's a monster in terms of resource consumption.

                      I tried wget where credentials is asking and in curl the file is not downloading where the test file created inside that file the link is there to download the file.So only using Chrome here

                      Show us the command you ran. I have a feeling you’re either not following a redirect or your output option is not set correctly.

                      curl -o "Link"

                      Could you please try what I posted above? And could you please bring some light in your requirements? What kind of authentication is required by the server? Basic HTTP Auth?

                      The process here is the internal site is there where the .csv files will be downloaded from the site through wget or curl or by browser.Where i tried from the wget i got the error as

                      "HTTP request sent, awaiting response... 401 Unauthorized"-->I think this for the AD username and password where the credentials part is not even asking.

                      How to try the above thing which was mentioned already

                      scottalanmillerS 1 Reply Last reply Reply Quote 0
                      • scottalanmillerS
                        scottalanmiller @Lakshmana
                        last edited by

                        @lakshmana said in Timeout in .sh file:

                        @stacksofplates said in Timeout in .sh file:

                        @lakshmana said in Timeout in .sh file:

                        @thwr said in Timeout in .sh file:

                        I would always use curl / wget / any other CLI tool before I would use Chromium (Chromium != Chrome) for a simple file download. It's a monster in terms of resource consumption.

                        I tried wget where credentials is asking and in curl the file is not downloading where the test file created inside that file the link is there to download the file.So only using Chrome here

                        Show us the command you ran. I have a feeling you’re either not following a redirect or your output option is not set correctly.

                        curl -o "Link"

                        RIght, we've known all along that that was not going to work. Stick to one thing, only look at cURL. Don't try to use Chrome, don't spend time trying to convince us that Chrome will work and cURL will not. You didn't include the credentials with cURL so of course it didn't work. If you look at the directions above, how to include the credentials was explained.

                        LakshmanaL 1 Reply Last reply Reply Quote 2
                        • scottalanmillerS
                          scottalanmiller @Lakshmana
                          last edited by

                          @lakshmana said in Timeout in .sh file:

                          @thwr

                          @thwr said in Timeout in .sh file:

                          @lakshmana said in Timeout in .sh file:

                          @stacksofplates said in Timeout in .sh file:

                          @lakshmana said in Timeout in .sh file:

                          @thwr said in Timeout in .sh file:

                          I would always use curl / wget / any other CLI tool before I would use Chromium (Chromium != Chrome) for a simple file download. It's a monster in terms of resource consumption.

                          I tried wget where credentials is asking and in curl the file is not downloading where the test file created inside that file the link is there to download the file.So only using Chrome here

                          Show us the command you ran. I have a feeling you’re either not following a redirect or your output option is not set correctly.

                          curl -o "Link"

                          Could you please try what I posted above? And could you please bring some light in your requirements? What kind of authentication is required by the server? Basic HTTP Auth?

                          The process here is the internal site is there where the .csv files will be downloaded from the site through wget or curl or by browser.Where i tried from the wget i got the error as

                          "HTTP request sent, awaiting response... 401 Unauthorized"-->I think this for the AD username and password where the credentials part is not even asking.

                          How to try the above thing which was mentioned already

                          So how does the site work, it just has a normal login form?

                          1 Reply Last reply Reply Quote 0
                          • LakshmanaL
                            Lakshmana @scottalanmiller
                            last edited by

                            @scottalanmiller If i am giving the .sh file to be runned with ny collegues system i cannot share that the executable file since it may lead Infosec Issue

                            scottalanmillerS 1 Reply Last reply Reply Quote 0
                            • black3dynamiteB
                              black3dynamite
                              last edited by

                              @scottalanmiller @stacksofplates @thwr

                              Is there a way to prompt the user for the credentials instead?

                              1 Reply Last reply Reply Quote 0
                              • scottalanmillerS
                                scottalanmiller @Lakshmana
                                last edited by

                                @lakshmana said in Timeout in .sh file:

                                @scottalanmiller If i am giving the .sh file to be runned with ny collegues system i cannot share that the executable file since it may lead Infosec Issue

                                How will that work regardless of the tool used?

                                LakshmanaL 1 Reply Last reply Reply Quote 1
                                • LakshmanaL
                                  Lakshmana @scottalanmiller
                                  last edited by

                                  @scottalanmiller said in Timeout in .sh file:

                                  @lakshmana said in Timeout in .sh file:

                                  @scottalanmiller If i am giving the .sh file to be runned with ny collegues system i cannot share that the executable file since it may lead Infosec Issue

                                  How will that work regardless of the tool used?

                                  @scottalanmiller said in Timeout in .sh file:

                                  @lakshmana said in Timeout in .sh file:

                                  @scottalanmiller If i am giving the .sh file to be runned with ny collegues system i cannot share that the executable file since it may lead Infosec Issue

                                  How will that work regardless of the tool used?

                                  That .sh file should download the data by terminal or by Browser inside the machine without using credentials!!!

                                  thwrT 1 Reply Last reply Reply Quote 0
                                  • thwrT
                                    thwr @Lakshmana
                                    last edited by thwr

                                    @lakshmana said in Timeout in .sh file:

                                    @scottalanmiller said in Timeout in .sh file:

                                    @lakshmana said in Timeout in .sh file:

                                    @scottalanmiller If i am giving the .sh file to be runned with ny collegues system i cannot share that the executable file since it may lead Infosec Issue

                                    How will that work regardless of the tool used?

                                    @scottalanmiller said in Timeout in .sh file:

                                    @lakshmana said in Timeout in .sh file:

                                    @scottalanmiller If i am giving the .sh file to be runned with ny collegues system i cannot share that the executable file since it may lead Infosec Issue

                                    How will that work regardless of the tool used?

                                    That .sh file should download the data by terminal or by Browser inside the machine without using credentials!!!

                                    Ok, full stop. What happens here is that your web server simply tells you: "Hey, dude, I would love to give you that file, but your f'ing unauthorized, so just leave me alone. I won't give you the file unless you can present me a valid auth".

                                    In other words: HTTP 401 Unauthorized.

                                    So what needs to be done is simple: we need to authenticate against the server. This does not relate to the client side in any way. You will see the same behavior in Internet Explorer, Edge, Chrome, misc. PowerShell cmdlets or whatever else you may use to access that file.

                                    Like SAM said, let us stop talking about client side tools for now. Let us instead discuss very basic authentication mechanisms.

                                    LakshmanaL 1 Reply Last reply Reply Quote 1
                                    • LakshmanaL
                                      Lakshmana @thwr
                                      last edited by

                                      @thwr said in Timeout in .sh file:

                                      @lakshmana said in Timeout in .sh file:

                                      @scottalanmiller said in Timeout in .sh file:

                                      @lakshmana said in Timeout in .sh file:

                                      @scottalanmiller If i am giving the .sh file to be runned with ny collegues system i cannot share that the executable file since it may lead Infosec Issue

                                      How will that work regardless of the tool used?

                                      @scottalanmiller said in Timeout in .sh file:

                                      @lakshmana said in Timeout in .sh file:

                                      @scottalanmiller If i am giving the .sh file to be runned with ny collegues system i cannot share that the executable file since it may lead Infosec Issue

                                      How will that work regardless of the tool used?

                                      That .sh file should download the data by terminal or by Browser inside the machine without using credentials!!!

                                      Ok, full stop. What happens here is that your web server simply tells you: "Hey, dude, I would love to give you that file, but your f'ing unauthorized, so just leave me alone. I won't give you the file unless you can present me a valid auth".

                                      In other words: HTTP 401 Unauthorized.

                                      So what needs to be done is simple: we need to authenticate against the server. This does not relate to the client side in any way. You will see the same behavior in Internet Explorer, Edge, Chrome, misc. PowerShell cmdlets or whatever else you may use to access that file.

                                      Like SAM said, let us stop talking about client side tools for now. Let us instead discuss very basic authentication mechanisms.

                                      I understood but in Browser the file will download from the cache credentials since the cookies make to download the data Right?????

                                      thwrT scottalanmillerS 2 Replies Last reply Reply Quote 0
                                      • thwrT
                                        thwr @Lakshmana
                                        last edited by

                                        @lakshmana said in Timeout in .sh file:

                                        @thwr said in Timeout in .sh file:

                                        @lakshmana said in Timeout in .sh file:

                                        @scottalanmiller said in Timeout in .sh file:

                                        @lakshmana said in Timeout in .sh file:

                                        @scottalanmiller If i am giving the .sh file to be runned with ny collegues system i cannot share that the executable file since it may lead Infosec Issue

                                        How will that work regardless of the tool used?

                                        @scottalanmiller said in Timeout in .sh file:

                                        @lakshmana said in Timeout in .sh file:

                                        @scottalanmiller If i am giving the .sh file to be runned with ny collegues system i cannot share that the executable file since it may lead Infosec Issue

                                        How will that work regardless of the tool used?

                                        That .sh file should download the data by terminal or by Browser inside the machine without using credentials!!!

                                        Ok, full stop. What happens here is that your web server simply tells you: "Hey, dude, I would love to give you that file, but your f'ing unauthorized, so just leave me alone. I won't give you the file unless you can present me a valid auth".

                                        In other words: HTTP 401 Unauthorized.

                                        So what needs to be done is simple: we need to authenticate against the server. This does not relate to the client side in any way. You will see the same behavior in Internet Explorer, Edge, Chrome, misc. PowerShell cmdlets or whatever else you may use to access that file.

                                        Like SAM said, let us stop talking about client side tools for now. Let us instead discuss very basic authentication mechanisms.

                                        I understood but in Browser the file will download from the cache credentials since the cookies make to download the data Right?????

                                        Yep. And it's a very bad idea to rely on something you can't control: a users cached cookies.

                                        LakshmanaL 1 Reply Last reply Reply Quote 1
                                        • scottalanmillerS
                                          scottalanmiller @Lakshmana
                                          last edited by

                                          @lakshmana said in Timeout in .sh file:

                                          @thwr said in Timeout in .sh file:

                                          @lakshmana said in Timeout in .sh file:

                                          @scottalanmiller said in Timeout in .sh file:

                                          @lakshmana said in Timeout in .sh file:

                                          @scottalanmiller If i am giving the .sh file to be runned with ny collegues system i cannot share that the executable file since it may lead Infosec Issue

                                          How will that work regardless of the tool used?

                                          @scottalanmiller said in Timeout in .sh file:

                                          @lakshmana said in Timeout in .sh file:

                                          @scottalanmiller If i am giving the .sh file to be runned with ny collegues system i cannot share that the executable file since it may lead Infosec Issue

                                          How will that work regardless of the tool used?

                                          That .sh file should download the data by terminal or by Browser inside the machine without using credentials!!!

                                          Ok, full stop. What happens here is that your web server simply tells you: "Hey, dude, I would love to give you that file, but your f'ing unauthorized, so just leave me alone. I won't give you the file unless you can present me a valid auth".

                                          In other words: HTTP 401 Unauthorized.

                                          So what needs to be done is simple: we need to authenticate against the server. This does not relate to the client side in any way. You will see the same behavior in Internet Explorer, Edge, Chrome, misc. PowerShell cmdlets or whatever else you may use to access that file.

                                          Like SAM said, let us stop talking about client side tools for now. Let us instead discuss very basic authentication mechanisms.

                                          I understood but in Browser the file will download from the cache credentials since the cookies make to download the data Right?????

                                          Right, so that is a reason to avoid that. you need to get the cookie cache and manage it. It's specifically for this kind of reason that cURL is the right tool. I've done exactly this in the past for automation where we needed a login AND a cookie cache and cURL handles this very well.

                                          1 Reply Last reply Reply Quote 1
                                          • LakshmanaL
                                            Lakshmana @thwr
                                            last edited by Lakshmana

                                            @thwr said in Timeout in .sh file:

                                            @lakshmana said in Timeout in .sh file:

                                            @thwr said in Timeout in .sh file:

                                            @lakshmana said in Timeout in .sh file:

                                            @scottalanmiller said in Timeout in .sh file:

                                            @lakshmana said in Timeout in .sh file:

                                            @scottalanmiller If i am giving the .sh file to be runned with ny collegues system i cannot share that the executable file since it may lead Infosec Issue

                                            How will that work regardless of the tool used?

                                            @scottalanmiller said in Timeout in .sh file:

                                            @lakshmana said in Timeout in .sh file:

                                            @scottalanmiller If i am giving the .sh file to be runned with ny collegues system i cannot share that the executable file since it may lead Infosec Issue

                                            How will that work regardless of the tool used?

                                            That .sh file should download the data by terminal or by Browser inside the machine without using credentials!!!

                                            Ok, full stop. What happens here is that your web server simply tells you: "Hey, dude, I would love to give you that file, but your f'ing unauthorized, so just leave me alone. I won't give you the file unless you can present me a valid auth".

                                            In other words: HTTP 401 Unauthorized.

                                            So what needs to be done is simple: we need to authenticate against the server. This does not relate to the client side in any way. You will see the same behavior in Internet Explorer, Edge, Chrome, misc. PowerShell cmdlets or whatever else you may use to access that file.

                                            Like SAM said, let us stop talking about client side tools for now. Let us instead discuss very basic authentication mechanisms.

                                            I understood but in Browser the file will download from the cache credentials since the cookies make to download the data Right?????

                                            Yep. And it's a very bad idea to rely on something you can't control: a users cached cookies.

                                            This script will not run on users .only on System Administrator machines only

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 3
                                            • 2 / 3
                                            • First post
                                              Last post