165_server_user_ssh.txt last updated Sunday 30th November 2008, 10:25 PT, AHD ******************************************************************************************* as root on a terminal, create user folders student1 - studentn in /var/www go server root: sudo -s cd /var/www ls -al stud* mkdir studentn make sure also that each student user belongs to the same group (student) and own their own folders in /var/www, e.g.: root@server:/var/www# chgrp student student4 chgrp student student5 etc (or use webadmin to Edit user - primary group - existing group - student) and each student user owns their own folder, e.g. chown student4 student4 do the above BEFORE you edit the directory path for the user in webadmin and use: ls -al to confirm this permissions should be: drwxr-xr-x anne2 anne (last = owner and group) (NB: user anne2 owns /var/www and has own SSH) Add new server users (student1, student2 etc) and set passwords, groups and home dir here: WebAdmin at https://server:10000/ and click on System->Users and Groups also in webadmin on System -> Users and Groups - set shell /bin/sh Edit user - to set home directory - MAKE SURE TO CLICK RADIO BUTTON ON HOME DIRECTORY _ DIRECTORY WebAdmin at https://server:10000/ and click on Servers-> SSH Server -> Access Control, and add usernames to "Only allow users" textbox AFTER any SSH Access Control changes are made, CLICK APPLY CHANGES or they will not take effect! Students' permissions: anne2@server:~$ pwd /var/www anne2@server:~$ ls -al student1 total 112 drwxr-xr-x 2 student1 student 4096 2008-11-30 10:36 . drwxrwx--x 201 anne2 root 77824 2008-11-30 09:44 .. -rw-r--r-- 1 student1 student 189 2008-11-24 13:17 01-01.php.txt -rw------- 1 student1 student 210 2008-11-30 10:39 .bash_history -rw-r--r-- 1 student1 student 514 2008-11-26 14:14 bmi.html -rw-r--r-- 1 student1 student 0 2008-11-26 13:43 bmi.php -rw-r--r-- 1 root root 57 2008-11-15 16:07 CSCI165A.txt -rw-r--r-- 1 student1 student 338 2008-11-24 14:08 lab 19.php -rw-r--r-- 1 student1 student 192 2008-11-24 13:31 lab 19.php.txt -rw------- 1 student1 student 605 2008-06-21 03:40 .viminfo anne2@server:~$ student1@server:~$ pwd /var/www/student1 student1@server:~$ ls -al total 112 drwxr-xr-x 2 student1 student 4096 2008-11-30 10:36 . drwxrwx--x 201 anne2 root 77824 2008-11-30 09:44 .. -rw-r--r-- 1 student1 student 189 2008-11-24 13:17 01-01.php.txt -rw------- 1 student1 student 210 2008-11-30 10:39 .bash_history -rw-r--r-- 1 student1 student 514 2008-11-26 14:14 bmi.html -rw-r--r-- 1 student1 student 0 2008-11-26 13:43 bmi.php -rw-r--r-- 1 root root 57 2008-11-15 16:07 CSCI165A.txt -rw-r--r-- 1 student1 student 338 2008-11-24 14:08 lab 19.php -rw-r--r-- 1 student1 student 192 2008-11-24 13:31 lab 19.php.txt -rw------- 1 student1 student 605 2008-06-21 03:40 .viminfo student1@server:~$ student1@server:~$ pwd /var/www/student1 student1@server:~$ cd .. student1@server:/var/www$ ls ls: .: Permission denied student1@server:/var/www$ root@server:/var# ls -al total 132 drwxr-x--x 16 root root 4096 2008-03-08 17:21 . drwxr-xr-x 21 root root 4096 2008-06-20 15:13 .. drwxr-xr-x 2 root root 4096 2008-11-08 07:35 backups drwxr-xr-x 13 root root 4096 2008-08-09 12:14 cache drwxr-xr-x 2 root root 4096 2008-03-08 14:27 games drwxr-xr-x 40 root root 4096 2008-11-11 07:45 lib drwxrwsr-x 2 root staff 4096 2006-08-03 03:59 local drwxrwxrwt 4 root root 100 2008-11-21 18:55 lock drwxr-xr-x 10 root root 4096 2008-11-30 07:35 log drwxrwsr-x 2 root mail 4096 2008-03-08 13:46 mail drwxr-xr-x 2 root root 4096 2008-03-08 13:46 opt drwxr-xr-x 15 root root 540 2008-11-30 07:35 run drwxr-xr-x 6 root root 4096 2008-03-08 14:15 spool drwxrwxrwt 3 root root 4096 2008-08-05 08:29 tmp drwx------ 2 root bin 4096 2008-03-09 08:59 webmin drwxrwx--x 201 anne2 root 77824 2008-11-30 09:44 www root@server:/var# ls backups games local log opt spool webmin cache lib lock mail run tmp www root@server:/var#