- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to restrict a user to a single directory?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2016 11:44 AM
03-22-2016 11:44 AM
How to restrict a user to a single directory?
I need to create a user on a 11.31 system and restrict that user to a single directory. The user should have no access to any other files or directories on the system.
Another possibility is to create an SFTP account for that purpose. So the user can only do put and get on the files in that directory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2016 09:28 PM
03-22-2016 09:28 PM
Re: How to restrict a user to a single directory?
> I need to create a user on a 11.31 system and restrict that user to a
> single directory. [...]
As before ( http://community.hpe.com/t5/x/x/m-p/6841471 ), it's often
more helpful to describe the actual problem which you are trying to
solve than it is to ask how to implement some particular "solution" to
that problem.
A forum search for keywords like, say:
sftp chroot
should find multiple old threads which cover the SFTP case, and which
might apply more generally.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2016 06:58 AM
03-24-2016 06:58 AM
Re: How to restrict a user to a single directory?
I did it, very simple actually:
sshd_config
Match User user1
ChrootDirectory /dir1
ForceCommand internal-sftp
AllowTcpForwarding no
X11Forwarding no
then create a user in the passwd file with the home dir of the above and /bin/false for shell.
chmod -R 755 /dir1
cd dir1; chmod -R 775 *
chown -R root:dba /dir1
The contents of the directory have to be owned by root
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2016 11:33 AM
03-24-2016 11:33 AM
Re: How to restrict a user to a single directory?
> I did it, very simple actually:
> [...]
For SFTP.
I've done this (long ago) for plain FTP, but not for SFTP. With
SFTP, does an SFTP client command like "ls" work without your creating
things like "/dir1/bin/ls" on the server?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2016 06:26 AM
04-01-2016 06:26 AM
Re: How to restrict a user to a single directory?
yes, ls -l works.