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

    Linux SCP issue

    IT Discussion
    linux scp ssh
    3
    21
    3.4k
    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.
    • stacksofplatesS
      stacksofplates @scottalanmiller
      last edited by

      @scottalanmiller said:

      @johnhooks said:

      As far as I know (I could be wrong) to scp to / you need to be root or sudo the scp

      Nope, nothing like that. SCP is just a protocol on SSH. If you can log in, you can SCP.

      Don't you need to have sudo permissions or be root to copy to the root folder though?

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

        @johnhooks said:

        Don't you need to have sudo permissions or be root to copy to the root folder though?

        Ah, not necessarily. But 99% of the time, yes.

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

          for i in find /home/msftp/cdr -type f -ctime -1

          Backticks are a bad practice from like a decade ago. It should be written this way:

          for i in $(find /home/msftp/cdr -type f -ctime -1)
          
          1 Reply Last reply Reply Quote 0
          • scottalanmillerS
            scottalanmiller
            last edited by

            Run this command manually, does it fail?

            scp $i [email protected]:/
            
            1 Reply Last reply Reply Quote 0
            • scottalanmillerS
              scottalanmiller
              last edited by

              What error are you getting? You asked us if there was a problem but did not state what issue you were having.

              bbigfordB 1 Reply Last reply Reply Quote 0
              • bbigfordB
                bbigford @scottalanmiller
                last edited by

                @scottalanmiller The remote server is administered by a different company. I was told just a few minutes ago that they haven't asked... Told them to use rsync but haven't heard back yet.

                scottalanmillerS 3 Replies Last reply Reply Quote 0
                • scottalanmillerS
                  scottalanmiller
                  last edited by

                  What is the output of this command?

                  find /home/msftp/cdr -type f -ctime -1
                  
                  1 Reply Last reply Reply Quote 0
                  • scottalanmillerS
                    scottalanmiller @bbigford
                    last edited by

                    @BBigford said:

                    @scottalanmiller The remote server is administered by a different company. I was told just a few minutes ago that they haven't asked...

                    Should not need to ask. If you have the right to log in as that user, you set up the key yourself. The other company likely has no control there. That would be unlikely.

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

                      @BBigford said:

                      @scottalanmiller The remote server is administered by a different company.

                      So the chances that you have access to write to / are nearly zero, then. That's probably your issue.

                      1 Reply Last reply Reply Quote 0
                      • bbigfordB
                        bbigford @scottalanmiller
                        last edited by

                        @scottalanmiller the admin says that the script will run, but simply doesn't copy. There's no error thrown (sorry that isn't more helpful). If he would get back to me already, I'd have him run those commands right now.

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

                          @BBigford said:

                          Told them to use rsync but haven't heard back yet.

                          Rsync is a good tool to use, of course, but unlikely to matter here.

                          1 Reply Last reply Reply Quote 0
                          • bbigfordB
                            bbigford
                            last edited by bbigford

                            Got it figured out. Turns out that the directory being called, didn't exist. All good now though, thanks for all the quick responses!

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

                              @BBigford said:

                              Got it figured out. Turns out that the directory being called, didn't exist. All good now though, thanks for all the quick responses!

                              It did exist, it's the filesystem root. The issue was that the user did not have permissions there 🙂 I'm sure this was caused by accidentally forgetting the correct directory when making the script, but there is a director specified, it's just not one you would want to use 🙂

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

                                Had to finish some stuff at work and eat dinner with the wife and kiddo, but I was thinking about it. Once they set up a key you can do this with one line (if you don't use a key you would need the password for each file).

                                find /home/msftp/cdr -type f -ctime -1 -exec scp {} [email protected]:/whatever/folder \;
                                
                                1 Reply Last reply Reply Quote 1
                                • scottalanmillerS
                                  scottalanmiller
                                  last edited by

                                  Yeah, you can get that to be pretty simple with a little work (and keys.)

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