Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Oct 15, 2015 1:18 pm 
Offline

Joined: Thu Oct 15, 2015 1:16 pm
Posts: 1
i have a linode and i access via ssh throw terminal. I need to create an sftp user which his default directory (and the only he can acces) is /var/www/xxxxxx.com/public_html/directory

Now, i did it, but when i try to connect i get broken pipe or connection rejected by peer

what i did is this:

Code:
$ adduser --home /var/www/xxxxxx.com/public_html/directory/ username
$ chown username:username /var/www/xxxxxx.com/public_html/directory/
$ chmod 755 /var/www/xxxxxx.com/public_html/directory/
$ nano /etc/ssh/sshd_config


In /etc/ssh/sshd_config add following lines

Code:
Match User username
   ChrootDirectory /var/www/xxxxxx.com/public_html/directory/
   AllowTCPForwarding no
   X11Forwarding no
   ForceCommand internal-sftp


What im doing wrong?


Top
   
PostPosted: Fri Oct 16, 2015 11:38 am 
Offline
Linode Staff

Joined: Mon Sep 29, 2014 4:47 pm
Posts: 90
Twitter: FelicianoTech
If you're jailing the user to '/var/www/xxxxxx.com/public_html/directory/', then that directory needs to be owned by root, not the user. Anything in the directory can be owned by the user however.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group