2

I'm on a new Centos 7 setup. So far I have logged in via ssh as root:

  • added a new user
  • gave user full permission via visudo
  • added user to the root group (not sure if this is needed)

Logged out and then logged in with the new user. I had already done a few things with the root user, such as install LAMP and add the directory /var/www/public_html/test/

I am able to delete the test directory via SSH, but I am not able to use a SFTP client to do so... when I am using a SFTP client (Transmit for MAC) I get permission denied.

So my question is... how do I give my user permissions that will let me use the SFTP client to complete basic operations such as add/remove/move?

Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232
gdaniel
  • 123

1 Answers1

0

You need to setup the SFTP service (it's part of SSH but often times is disabled). Take a look at my answer to this U&L Q&A titled: How can I create an SFTP user in CentOS?.

The key bits are making the following changes to your SSHD setup.

Make these changes to your /etc/ssh/sshd_config file.

  Subsystem       sftp    internal-sftp

  ## You want to put only certain users (i.e users who belongs to 
  ## sftpusers group) in the chroot jail environment. Add the following
  ## lines at the end of /etc/ssh/sshd_config

  # Match Group sftpusers  
  #   ChrootDirectory /sftp/%u  
  #   ForceCommand internal-sftp

Then restart your SSHD service:

$ sudo service sshd restart
slm
  • 369,824