Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Security and Privacy
FedoraForum Search

Forgot Password? Join Us!

Security and Privacy Sadly, malware, spyware, hackers and privacy threats abound in today's world. Let's be paranoid and secure our penguins, and slam the doors on privacy exploits.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 31st May 2011, 04:59 PM
newbie14 Offline
Registered User
 
Join Date: Feb 2010
Posts: 104
windows_xp_2003ie
Ssh and SFTP access control

Dear All,
I have allowed remote user to log into the server via these two (SSH and SFTP) method. The problem now I have read on the net some are talking about chroot etc. What I want is actually say a particular user I want to allow only certain folder to be accessed when he/she logs in what is the best method to achieve this.
Reply With Quote
  #2  
Old 7th June 2011, 05:20 AM
flyingfsck Offline
Registered User
 
Join Date: Aug 2010
Location: Al Ain, UAE
Posts: 1,054
linuxfirefox
Re: Ssh and SFTP access control

Howdy,

There are various methods that can be enforced from outside of the SSH and FTP applications.

You should read up on groups, ACLs and SELinux.

Cheers,

F.
Reply With Quote
  #3  
Old 7th June 2011, 11:54 AM
newbie14 Offline
Registered User
 
Join Date: Feb 2010
Posts: 104
windows_xp_2003ie
Re: Ssh and SFTP access control

Dear Flyingfsck,
I am confuse with these various method. As a newbie what is the best method you recommend for me? Can you guide me a bit in depth? Thank you.
Reply With Quote
  #4  
Old 7th June 2011, 01:55 PM
smr54 Online
Registered User
 
Join Date: Jan 2010
Posts: 4,979
linuxopera
Re: Ssh and SFTP access control

For ACLs you can look at

http://www.vanemery.com/Linux/ACL/linux-acl.html

Even though it's old, it's still applicable.

Unfortunately, I doubt that anyone will really have the time to give you in depth training on this. These various methods are somewhat complex, and it's very seldom that someone has the patience to guide a beginner completely through something. There are various guides and howtos, some on this forum. However, in depth guidance is almost asking for a consultant.
Reply With Quote
  #5  
Old 7th June 2011, 04:11 PM
newbie14 Offline
Registered User
 
Join Date: Feb 2010
Posts: 104
windows_xp_2003ie
Re: Ssh and SFTP access control

Dear Smr54,
I do understand but I do need something very heavy. I am looking for something simple where I would like to restrict the user to limited folders. So is there any other simple sites which can guide in depth. What different between acl,chroot or vsftpd?
Quote:
Originally Posted by smr54 View Post
For ACLs you can look at

http://www.vanemery.com/Linux/ACL/linux-acl.html

Even though it's old, it's still applicable.

Unfortunately, I doubt that anyone will really have the time to give you in depth training on this. These various methods are somewhat complex, and it's very seldom that someone has the patience to guide a beginner completely through something. There are various guides and howtos, some on this forum. However, in depth guidance is almost asking for a consultant.
Reply With Quote
  #6  
Old 7th June 2011, 04:22 PM
smr54 Online
Registered User
 
Join Date: Jan 2010
Posts: 4,979
linuxopera
Re: Ssh and SFTP access control

Ah, I see. I think the easiest way to do it would be with sftp chroot. Darn, I saw a guide on that recently---hold on a minute

Hrrm, try this one.

http://v2.robbyt.com/2008/howto/chro...ith-openssh-5/

Ok, the difference. AD is Active Directory, a Windows way of doing things. It's actually quit good, LDAP made simple that works, but is only available on Windows servers.

ACL is Access Control List and can be useful when working with granular permissions, as described in the link in my other post. It's good when you want to give one group read permissions, and another group read/write, for example.

chroot is Change Root, and means that when someone logs in they are chrooted to a directory--that is, that directory is their root directory and they can't get any higher. For example, user john is chrooted to john's home directory. This means, when he logs in, he is in john's directory, but if he runs the command cd ../ to go up one directory, he cannot. It's often called a chroot jail, because the user is jailed, so to speak, in that directory.

The howto that I list in this post should explain how to do that.

Last edited by smr54; 7th June 2011 at 04:26 PM.
Reply With Quote
  #7  
Old 7th June 2011, 06:44 PM
flyingfsck Offline
Registered User
 
Join Date: Aug 2010
Location: Al Ain, UAE
Posts: 1,054
linuxfirefox
Re: Ssh and SFTP access control

Howdy,

SSH has a chroot feature built in. Read the man pages and read the Snail Book:
http://www.snailbook.com/

Google has a special Linux related search engine: http://google.com/linux

Cheers,

F.
Reply With Quote
  #8  
Old 20th June 2011, 07:49 PM
SlowJet Offline
Registered User
 
Join Date: Jan 2005
Posts: 5,002
linuxfedorafirefox
Re: Ssh and SFTP access control

A user name under the USERS group log on account is restricted to a set of dir's with
chmod set on first attribute 7400 to not allow dir delete and read only on all the sub files 5400.

Selinux should label the files correctly during first log on except for any setuid on first attribute and exec on dirs.
and any more restrictive permissions. It is all about the planning.
And of course any user that knows of another user and there password can do what they do also.
If root pasword is known, they can't be stopped from doing anything and the root password can be changed from the grub boot up so if your buddy knows too much and has access to your computer, then it is his computer also.

See man pages for

chmod
fixfiles
setfiles
restorecon

SJ
__________________
Do the Math
Reply With Quote
  #9  
Old 21st June 2011, 11:47 AM
stevea's Avatar
stevea Offline
Registered User
 
Join Date: Apr 2006
Location: Ohio, USA
Posts: 8,300
linuxfedorafirefox
Re: Ssh and SFTP access control

If you really prevent access (read/execute on directories and execute on binaries) then the user can't execute any commands at all. I'm pretty sure that is not what you want. ssh would be useless.

Maybe you need to think through the consequences a little deeper. If a user can read-access a file then they can make a copy (by sftp of by ssh & cp). It really makes no sense to prevent read access to common binaries - the user could download the binary from another source. If you give users read-access to a directory, then they can access files under that dir. But if they have execute on the dir - then they can search it. Unless you are trying for "security by obscurity" then you don't want to restrict execute on the directories the user needs.

Maybe you should approach the problem a little differently - use 'find' to show all the directories owned (or group-owned) by the users outside their home directories . Then again use 'find' to show all the directories that anyone can write. Yo may want to tighten read/exceute directory access on user's and roots home directory, but who cares if a user does an ls on /etc/sysconfig ?
__________________
None are more hopelessly enslaved than those who falsely believe they are free.
Johann Wolfgang von Goethe
Reply With Quote
  #10  
Old 22nd June 2011, 02:37 AM
SlowJet Offline
Registered User
 
Join Date: Jan 2005
Posts: 5,002
windows_xp_2003ie
Re: Ssh and SFTP access control

Yes, whatever the attr should be is needed.
My point was that it didn't take much in computer effort to make a very secure environment for a user, but a lot of reading and planning to get to that point.

SJ
__________________
Do the Math
Reply With Quote
Reply

Tags
access, control, sftp, ssh

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't access F7 box with sftp or scp pobbz Servers & Networking 0 19th October 2007 10:27 AM
sftp creating restricted shell for sftp only 105547111 Using Fedora 3 29th May 2007 02:14 AM
chroot accounts with sftp access fusi0n Security and Privacy 3 10th November 2006 02:03 AM
dvb and access control MFrandsen Installation and Live Media 0 18th March 2006 07:30 AM
SSH SFTP User access johnk Servers & Networking 3 3rd October 2005 04:43 AM


Current GMT-time: 00:00 (Thursday, 23-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat