Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Apr 23, 2015 12:24 am 
Offline
Senior Newbie

Joined: Mon Sep 29, 2014 1:21 am
Posts: 17
My current setup which works: sshd_config file:

Code:
Subsystem sftp internal-sftp


Code:
Match group filetransfer2
    ChrootDirectory %h
    X11Forwarding no
    AllowTcpForwarding no
    ForceCommand internal-sftp

Linux commands I ran:

Code:
addgroup --system filetransfer
usermod -G filetransfer username
chown root:root /home/username
chmod 755 /home/username
cd /home/username
mkdir docs public_html
chown username:filetransfer *

And the username is restricted to /home/username folder and works perfectly. Now what i try to do is limit username to: /home/somefolder/public/domain.com/

When I use sudo usermod --home username /home/somefolder/public/domain.com/ it changes the default directory of username when logged in with sftp. Although it refuses to login. I've also tried all the above steps while using /home/somefolder/public/domain.com/ without luck, it refuses to login sftp.

I have to give some support desk my sftp login and obviously I don't want to give them my root login details and therefor want to limit them to the domain.com folder.

What am I doing wrong?

Thanks


Top
   
PostPosted: Thu Apr 23, 2015 4:21 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
It's probably a permissions issue, the chroot directory has to be owned by root so chown root:root /home/somefolder/public/domain.com/ may fix it, check /var/log/auth.log for errors (assuming you're using debian/ubuntu)

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
PostPosted: Thu Apr 23, 2015 4:41 am 
Offline
Senior Newbie

Joined: Mon Sep 29, 2014 1:21 am
Posts: 17
Yeh good point. I had to root:root all the folders that were above that. Thanks!


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


Who is online

Users browsing this forum: No registered users and 2 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