Giving user extremely limited access

MJCfromCT

Gawd
Joined
Jun 27, 2006
Messages
735
Hi all,

I'm in a situation where I need to grant limited access to a user on my linux machine. Ideally, I'd like this person to ONLY be able to SSH into the machine, browse ONE directory (e.g. /home/myusername/mystuff/, and all the subfolders w/in this directory), and be able to view and copy files from this folder to his local machine, but not be able to move, delete, or create files in that directory. Is it possible to set up an account to do this? I'd like this person not to be able to log into the machine and be fiddling in the GUI.

Machine is running Ubuntu 7.04, if that helps. Thanks for the help in advance!
 
I'm in a situation where I need to grant limited access to a user on my linux machine. Ideally, I'd like this person to ONLY be able to SSH into the machine,
This is not a problem.
browse ONE directory (e.g. /home/myusername/mystuff/, and all the subfolders w/in this directory),
By default the home directory is like this, and this person will not be able to see into the other home directories. As for being able to browse the system directories (/bin, /usr, and so forth), normal users have no write access and must be able to read and execute from them. So taking away read access to these directories is a bad idea. Selectively restricting access to certain executables is possible, but it would be a lot of work. Why bother? If you're concerned about exploits, you need to be re-evaluating the need to hand out shell access to this person, and implementing a real security policy, starting with some type of MAC.
and be able to view and copy files from this folder to his local machine, but not be able to move, delete, or create files in that directory. Is it possible to set up an account to do this?
This is weird. A user owns whatever is in their home directory... that's what it's for.
I'd like this person not to be able to log into the machine and be fiddling in the GUI.
Then don't start a VNC server.

Anyway, It sounds like you really don't want to give SSH access to this person. You should look into setting up a restricted FTP server, or just a plain read-only HTTP server.
 
Thanks for the reply.

I'd not run a VNC server, but I need it for myself, so I might have to look into setting up an ftp.

I would think it would be easy if the only directory I needed this user to access was /home/newuser, but I want them to be able to access /home/myuser/folder/ instead. I don't know enough about setting permissions to make that happen, unfortunately.

If the user has to have 777 rights to their home directory, is there a way to implement a size restriction on their home folder? (say, cannot exceed 10mb?)

you need to be re-evaluating the need to hand out shell access to this person

Believe me, if it were entirely up to me, this person wouldn't have access, but my hand is being forced. I just want them to be able to do as little as possible and provide minimal interruption/headaches to me.
 
If the user has to have 777 rights to their home directory, is there a way to implement a size restriction on their home folder? (say, cannot exceed 10mb?)
Some filesystems support quotas. The functionality needs to be compiled into your kernel, and I have no idea if Ubuntu's kernel has it turned on.

Another way is to mount a small partition or logical volume as the user's home. This has the advantage of preventing hardlink attacks, and allows the use of the noexec, nosuid, nodev mount options, which make life slightly harder for an attacker.

Believe me, if it were entirely up to me, this person wouldn't have access, but my hand is being forced.
This must be a workplace machine. Otherwise, I'd tell whoever wanted shell access to one of my boxes where to stick it. Why not set up a nice web server for whatever files this person needs to get at? From what you said earlier, it sounds like they don't need write access.
 
Set up an account using a restricted shell? Check out the bash man page on "restricted shell"
 
Back
Top