Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Tue Sep 06, 2011 5:10 am 
Offline
Senior Newbie

Joined: Thu Nov 25, 2010 5:22 am
Posts: 8
I have an Ubuntu LAMP stack where different sites are hosted.

I want to create users so that can S/FTP to a specific directory of a single domain.

Anyone can point me in the right direction? A linode library article perhaps?

regards,
goliatone

[Edit] Like Musfuut pointed out, I forgot to mention the flavor of linux I'm using. Ubuntu ;)


Last edited by goliatone on Tue Sep 06, 2011 5:44 am, edited 1 time in total.

Top
   
 Post subject:
PostPosted: Tue Sep 06, 2011 5:29 am 
Offline
Senior Newbie

Joined: Fri Aug 05, 2011 6:15 am
Posts: 15
You don't mention your distro but here is a link from the library regarding debian and ubuntu.

http://library.linode.com/security/sftp-jails

I just recently set up a jailed sftp for our web designer to have access to "his" content.

It isn't too too hard to set up.


Top
   
 Post subject:
PostPosted: Tue Sep 06, 2011 5:46 am 
Offline
Senior Newbie

Joined: Thu Nov 25, 2010 5:22 am
Posts: 8
Thanks Musfuut!
That looks like it should do the trick.

I've been looking on the library but I think I was missing a...search criteria.

regards,
goliatone


Top
   
 Post subject:
PostPosted: Tue Sep 06, 2011 5:48 am 
Offline
Senior Newbie

Joined: Fri Aug 05, 2011 6:15 am
Posts: 15
Hehe don't worry about it! I find myself lost at the library too sometimes. :)

Good luck!


Top
   
 Post subject:
PostPosted: Tue Sep 06, 2011 11:49 am 
Offline
Senior Newbie

Joined: Thu Nov 25, 2010 5:22 am
Posts: 8
Okis,
Now, the way I read this is that I am creating a user and giving access to the user through sftp to that users home directory and that's it.

The thing is that I want my user to be able to manage the files inside the public_html of a domain, let's say:
/srv/www/my-domain.com/public_html/*

I'm not sure this accomplishes the same thing.


Top
   
 Post subject:
PostPosted: Tue Sep 06, 2011 1:45 pm 
Offline
Senior Newbie

Joined: Fri Aug 05, 2011 6:15 am
Posts: 15
Yep, basically you create a new user, if you don't want them to be able to log in to the shell edit their line in /etc/passwd and change their /bin/bash to /bin/false

Then have your directory

/srv/www/my-domain.com/public_html/*

you make sure root owns srv, www, and my-domain.com

The user needs to own public_html and the files inside of it

then edit /etc/ssh/sshd_config per the instructions

set their chroot directory to /srv/www/my-domain.com/

When they log in they will be resticted to my-domain.com and whatever folders are inside of it, including public_html.

Hope this helps, write back if you have any more questions. :)


Top
   
 Post subject:
PostPosted: Tue Sep 06, 2011 1:54 pm 
Offline
Senior Newbie

Joined: Thu Nov 25, 2010 5:22 am
Posts: 8
ok, i see what you mean.
I also just ended up on this thread, which is quite explanatory as well.

One question. I need to have some directories (cache, logs) to be owned by the www-data user so my app can write to them. So, if I change the ownership of my-domain.com then I need to later reassign those back to the www-data user, right?


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


Who is online

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