Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have problem when I want to config my SSH server, I have username root and guest.

I want root still can access SSH and for guest users , only can transfer file (copy and paste) some directory.

in my problem is when I am login using guest users with SCP,SFTP,SSH it's possible to view my Filesystem in server,i think it's not good for security.

I want to make secure if Guest login using ssh,sftp,scp, only some folder I am configuration is showed, example (/var/www/site)

Any suggestion How I can make like that ?

share|improve this question
  1. Create a new group, e.g. 'scponly'.
  2. Create the target user accounts and set their home directory to the intended path, e.g. /var/www/site. Add these user accounts to group scponly.
  3. Add this to /etc/ssh/sshd_config:

    Match Group scponly
      ChrootDirectory %h
      ForceCommand internal-sftp
      AllowTcpForwarding no
      AllowAgentForwarding no
      X11Forwarding no
    

Now the users in group scponly will not be able to login to the system but only use SFTP/SCP. And they will be restricted to their home directory which will be shown as /.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .