I am a graduate student and want to set up a linux server (preferably Ubuntu) in my office. I also want to give my friends SSH access to that box.
My question is can I set up my server such that I can give one of my friends rights to install software on my machine but he cannot brows around outside the directory he is allowed to?
Can I set up multiple apache instances (on different ports) for different people? so each has access to their own apache instance?
-
you can do this with finely controlled access in the
/etc/sudoersfile. as root, you will want to run the commandvisudoand add something along the lines of:username ALL = (root) /usr/bin/apt-get update, \ /usr/bin/apt-get installor:
username ALL = (root) /path/to/yum installdepending on if you're using centos or some other distribution that uses
yumor debian/ubuntu, which usesaptandapt-getthose lines, in the
/etc/sudoersfile would allowusernameto run the commands/usr/sbin/apt-get updateand/usr/sbin/apt-get install [packagenamex]or/path/to/yum install [packagenamex]as the root user, and they will be prompted for /their/ password, not root's. they will have no other privileged access to the machine.beyond that, most packages can be compiled from source with commands like:
./configure --prefix=/home/username make make installwhich will install the package to their home directory, usually creating a
~/bin~/liband~/usr, etc directories.so maybe
./configure --prefix=/home/username/localor something would be more appropriate.for setting up apache httpd, to allow each user their own control over their own virtualhost, etc, without running multiple instances, you can add an option to the apache configuration, something like
/etc/apache2/apache2.conf, a line that says:Include /home/*/httpd/user.confthe configuration file can be named whatever you want, whatever might be more appropriate, but what this tells apache is to look in
/home/*/httpd/(where*is translated as aglobto whatever subdirectories are under/home) for a file calleduser.confwhere you can permit your users to add information aboutVirtualHostsa normal user could install or configure apache to run out of their home directory on a non-privileged port, if you wanted to grant them access in that way. a non-priv port being anything over 1024, they would have to add a directive to their personal apache configuration saying something like
Listen ip.add.re.ss:8888starting an apache httpd server running on port 8888to be sure they cannot browse into your, or anyone else's home directories, make sure they are set
chmod 700orchmod 711(to allow apache httpd access to execute their directory, to get through to/home/username/public_htmlif you want to have user dirs in apache) you can test this by doingls -ld /home/usernameit should show:drwx------ 185 username users 36864 May 18 17:05 /home/username/for permissions
700, anddrwx--x--xfor711. if it shows updrwxr-xr-xthen you will need to runchmod 700 /home/usernameorchmod 711 /home/usernamecpbills : added information about apache and allowing multiple users personalized access.From cpbills
0 comments:
Post a Comment