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

    sftp without ssh shell access?

    IT Discussion
    ssh sftp
    5
    6
    680
    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.
    • 1
      1337
      last edited by

      Is it possible to set up openssh so that some users would only be able to connect with a sftp client but wont have regular ssh shell access?

      V 1 Reply Last reply Reply Quote 0
      • V
        VoIP_n00b @1337
        last edited by VoIP_n00b

        https://tecadmin.net/create-sftp-only-user-centos/

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

          Yes, it's actually the standard for SFTP servers.

          1 Reply Last reply Reply Quote 3
          • 1
            1337
            last edited by

            Thanks guys.

            To summarize the link above, it's these lines in sshd_config that does the magic.

            Match User sftpuser
                 ForceCommand internal-sftp
                 <snip>
            

            The first line will tell sshd what user(s) the rest of the settings apply to.
            The second line tells it to go straight into sftp mode. So this will only apply to the users that match the rule above.

            black3dynamiteB dbeatoD 2 Replies Last reply Reply Quote 0
            • black3dynamiteB
              black3dynamite @1337
              last edited by

              @Pete-S said in sftp without ssh shell access?:

              Thanks guys.

              To summarize the link above, it's these lines in sshd_config that does the magic.

              Match User sftpuser
                   ForceCommand internal-sftp
                   <snip>
              

              The first line will tell sshd what user(s) the rest of the settings apply to.
              The second line tells it to go straight into sftp mode. So this will only apply to the users that match the rule above.

              If possible, I would use Match Group instead.

              1 Reply Last reply Reply Quote 3
              • dbeatoD
                dbeato @1337
                last edited by

                @Pete-S said in sftp without ssh shell access?:

                Thanks guys.

                To summarize the link above, it's these lines in sshd_config that does the magic.

                Match User sftpuser
                     ForceCommand internal-sftp
                     <snip>
                

                The first line will tell sshd what user(s) the rest of the settings apply to.
                The second line tells it to go straight into sftp mode. So this will only apply to the users that match the rule above.

                Just make sure to test SSH after you do the changes ok a new session otherwise you might just have broken SSH access.

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