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

    Solved OpenSSH installed, but cannot use SCP

    IT Discussion
    linux centos 6.7 ssh scp openssh centos rhel rhel 6 centos 6
    7
    44
    7.9k
    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.
    • S
      scottalanmiller
      last edited by

      Okay, SCP definitely exists on CentOS 6.7 so....

      Let's start with figuring out what the default shell is.

      What is the output of...

      grep USERNAME /etc/passwd
      

      Where USERNAME is the username of the account that you are using for the SCP connection. This is on the server side.

      K 1 Reply Last reply Reply Quote 0
      • K
        Kelly @scottalanmiller
        last edited by

        @scottalanmiller said:

        Okay, SCP definitely exists on CentOS 6.7 so....

        Let's start with figuring out what the default shell is.

        What is the output of...

        grep USERNAME /etc/passwd
        

        Where USERNAME is the username of the account that you are using for the SCP connection. This is on the server side.

        operator❌11:0:operator:/<username>:/sbin/nologin

        S 1 Reply Last reply Reply Quote 0
        • S
          scottalanmiller @Kelly
          last edited by

          @Kelly said:

          operator❌11:0:operator:/<username>:/sbin/nologin

          That's the issue. No shell from which to run SCP.

          1 Reply Last reply Reply Quote 0
          • S
            scottalanmiller
            last edited by

            SCP is part of SSH. To use it the account needs to login. Same as SFTP. You can't restrict an SSH account in this way. Nogin blocks SSH completely.

            K 1 Reply Last reply Reply Quote 0
            • K
              Kelly @scottalanmiller
              last edited by

              @scottalanmiller said:

              SCP is part of SSH. To use it the account needs to login. Same as SFTP. You can't restrict an SSH account in this way. Nogin blocks SSH completely.

              So what do I need to do to fix it?

              1 Reply Last reply Reply Quote 0
              • S
                scottalanmiller
                last edited by

                Where you have /sbin/nologin you need to have /bin/bash instead.

                K 1 Reply Last reply Reply Quote 2
                • K
                  Kelly @scottalanmiller
                  last edited by

                  @scottalanmiller said:

                  Where you have /sbin/nologin you need to have /bin/bash instead.

                  Ok, I edited /etc/passwd to change /sbin/nologin to /bin/bash. No change. When I'm logged in as root and just type scp I'm still getting command not found.

                  1 Reply Last reply Reply Quote 0
                  • S
                    scottalanmiller
                    last edited by

                    Okay, now THAT is weird. The weirdest part was that I was able to predict that you had nologin in the /etc/passwd file and that turned out to be true, but not the issue!!!

                    1 Reply Last reply Reply Quote 1
                    • S
                      scottalanmiller
                      last edited by

                      With root, what does this return:

                      which scp
                      
                      K 1 Reply Last reply Reply Quote 1
                      • S
                        scottalanmiller
                        last edited by

                        Wait, you checked on OpenSSH... client or server? What OpenSSH packages do you actually have there. List them all...

                        rpm -qa | grep ssh
                        
                        1 Reply Last reply Reply Quote 0
                        • K
                          Kelly @scottalanmiller
                          last edited by

                          @scottalanmiller said:

                          With root, what does this return:

                          which scp
                          

                          /usr/bin/which: no scp in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)

                          (how do you use code blocks?)

                          openssh-5.3p1-112.el6_7.x86_64
                          openssh-server-5.3p1-112.el6_7.x86_64
                          libssh2-1.4.2-1.el6_6.1.x86_64

                          1 Reply Last reply Reply Quote 0
                          • S
                            scottalanmiller
                            last edited by

                            Code blocks is just for spaces at the beginning of a line.

                            J 1 Reply Last reply Reply Quote 0
                            • S
                              scottalanmiller
                              last edited by

                              Okay, OpenSSH is missing files.

                              yum reinstall openssh
                              
                              1 Reply Last reply Reply Quote 2
                              • K
                                Kelly
                                last edited by

                                No joy. I'm still getting the same output when I run just scp or which scp.

                                S 1 Reply Last reply Reply Quote 0
                                • S
                                  scottalanmiller
                                  last edited by

                                  What is the history on this remote server? What was installed, what modified since it was put in?

                                  K 1 Reply Last reply Reply Quote 0
                                  • J
                                    JaredBusch @scottalanmiller
                                    last edited by

                                    @scottalanmiller said:

                                    Code blocks is just for spaces at the beginning of a line.

                                    That is a shortcut for single line.

                                    A full block is three backticks on a line by itself, then the code, then three backticks on a line by itself to close it.

                                    S K 2 Replies Last reply Reply Quote 3
                                    • S
                                      scottalanmiller @JaredBusch
                                      last edited by

                                      @JaredBusch said:

                                      @scottalanmiller said:

                                      Code blocks is just for spaces at the beginning of a line.

                                      That is a shortcut for single line.

                                      A full block is three backticks on a line by itself, then the code, then three backticks on a line by itself to close it.

                                      That's way handier than what I have been doing. I need to start doing that.

                                      1 Reply Last reply Reply Quote 2
                                      • S
                                        stacksofplates @Kelly
                                        last edited by

                                        @Kelly said:

                                        No joy. I'm still getting the same output when I run just scp or which scp.

                                        On both servers or just one?

                                        K 1 Reply Last reply Reply Quote 0
                                        • K
                                          Kelly @scottalanmiller
                                          last edited by

                                          @scottalanmiller said:

                                          What is the history on this remote server? What was installed, what modified since it was put in?

                                          Brand new, clean install. The only thing I've done on it is run updates.

                                          S 1 Reply Last reply Reply Quote 0
                                          • K
                                            Kelly @stacksofplates
                                            last edited by

                                            @johnhooks said:

                                            @Kelly said:

                                            No joy. I'm still getting the same output when I run just scp or which scp.

                                            On both servers or just one?

                                            I'm trying to copy from my MBP to the server, and I'm just getting that on the remote server.

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