Hello,
I need to create a user on my B3 box and I want to restrict his access to only one folder.
Can this be done? If yes, how?
New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !
Allowing an user to only access a folder (SSH)
Re: Allowing an user to only access a folder (SSH)
Hi romtoc,
What do you mean with "access"?
You can control Read, Write, and Execute permissions...
What do you mean with "access"?
You can control Read, Write, and Execute permissions...
Re: Allowing an user to only access a folder (SSH)
Hello Cheeseboy,
Thanks for your reply.
By "access", I meant the user can only read/write and execute files in a directory.
Thanks for your reply.
By "access", I meant the user can only read/write and execute files in a directory.
Re: Allowing an user to only access a folder (SSH)
Probably your best bet would be to create a wrapper script and assign that to be the users shell. Something like...
Code: Select all
#!/bin/bash
while read command params; do
if [ ! -z `echo grep -e "^"$command"$" /some_location/allowed_commands.lst`]; then
eval $command $params
fi
done
Re: Allowing an user to only access a folder (SSH)
Indeed, you cannot fully restrict SSH read/write to a certain folder without restricting the possible command list this user can execute.
I suppose what might work is setting low quota on the root dir for this user to prevent writing, but it's a dirty trick and he'll probably experience crashes from commands that want to write some temp stuff.
A more sophisticated method is presented here: http://www.jmcresearch.com/projects/jail/
I suppose what might work is setting low quota on the root dir for this user to prevent writing, but it's a dirty trick and he'll probably experience crashes from commands that want to write some temp stuff.
A more sophisticated method is presented here: http://www.jmcresearch.com/projects/jail/
Re: Allowing an user to only access a folder (SSH)
Ok, thanks for your help.
I found a simple method... a web file-manager...
I found a simple method... a web file-manager...
-
- Posts: 904
- Joined: 09 Oct 2009, 18:49
Re: Allowing an user to only access a folder (SSH)
But the Bubba already has one! :Sromtoc wrote:Ok, thanks for your help.
I found a simple method... a web file-manager...
Re: Allowing an user to only access a folder (SSH)
I used a more advanced one where I can change the permissions.