Server Administrator  Commands

To use most of these commands, log in to bell as root using ssh (eg putty for Windows). First log in as yourself then type
su -   to become root. Do not omit the - or paths won't be correctly set.

                                                                Locally written commands

The following are locally installed commands used either in place of commands supplied with the operating system or installed when not provided.  There is no documentation on these with the operating system (eg in man pages)

Adding users

To add a user to server bell
It is advisible to ensure that this command is not being executed on the hour or at multiples of 12 minutes past the hour as this is when local passwords are updated from the UCL IS database giving a slight risk of password file corruption.

Obtain the email address of the user to be added.
Obtain the UCL IS user name of the user to be added.
If the user name is not one prefixed by one of ucly ssly ucjt ucty ccaa ucza xsly, then their UCL IS password
will not be automatically inserted or changed when it does in the UCL IS database. One will need to be set using the passwd command. This also applies if a non UCL user name is used. These should not normally be used.

Type the command:  add_user
DO NOT USE ANY OTHER ADD USER COMMAND.

Type in the information as it is requested by the prompts.  The next available uid number one greater than the
highest already used for users will be automatically selected if another is not chosen.  Use the default unless 
there is a special reason not to.

The user's name should be automatically displayed and inserted if the user name used is found in the UCL IS database.
When the add_user program exits the new user will have had instructions for
new users mailed to the email address entered for that user. This includes computing regulations and info on how to log into bell and to get help.

The user may have to wait for up to 12 minutes before they can log in when their password will have been inserted from the UCL IS database.

If the user urgently needs to log in, the command /usr/local/sbin/update_ucl_passwd
can be run. This should not normally be done.

The user's entry can be checked with grep user_name /etc/passwd.
Format of /etc/passwd is:-
username:x:UID:GID:full name:home dir:shell

An entry for the added user is placed in the files:-
/etc/passwd (used for Unix and Samba logins)
/etc/shadow (for Unix password)
/etc/samba/smbpasswd (for Samba password)

A record will be inserted in /var/log/passwd_updated_log when their password has been inserted or updated.

To add a user to server Wave

Wave, used by a few research users has a subset of users on Server bell.
The user must exist on bell before being added to wave.

To add a user to wave, determine the username from bell /etc/passwd, log in as
root to wave and type: add_user and follow prompts.

Deleting users  (bell and wave)

To delete a user from bell, find the username and  log in as root and  type the command  del_user  and follow prompts. It is also advisable not to use this command at the times listed above.

DO NOT USE ANY OTHER DELETE USER COMMAND.

Finding the UCL IS user name of a user

At the bell Unix prompt type the command: ucl_users.
A list of usage options will be displayed.
This command is restricted to Chandler House technical staff logins.

To list user names and full names of users logged in to bell via samba

At the bell Unix prompt type the command:  smb_logins This is a front end to the Linux supplied command  smbstatus which gives more information including IP address of connecting samba client PC but does not give full names of logged in users.


                                            Other commonly required administration tasks

To find a username
Log in as any user  and type: grep -i "any part of username or full name"  /etc/passwd

All matches will be listed with format:-

username:x:UID:GID:Full Name:shell


Resetting a user's password
This should be used only if the user name is not a UCL IS user name or is not prefixed by those listed above.
Otherwise it will be set back to the UCL IS password within 12 minutes.

Log in as root
Type  the command:  passwd  username           where "username" is the user name of the user.

 
Editing a user's quota
type: edquota username

That user's quota information will be displayed under the joe editor.

The displayed filesystems map to the following directory names:-
/dev/mapper/VolGroup01-LogVol01        /home         (also includes anon ftp area)
 /dev/mapper/VolGroup01-LogVol05       /backup     (for pc backup)
 /dev/mapper/VolGroup01-LogVol11       /web          (all web space)

Change the numbers for hard and soft for the selected filesystem. Megabytes allocated are these numbers divided by 1000.
Default soft is /home 500MB, /backup 1GB, /web 100MB
Ensure that hard is 10MB greater than soft. Note that number columns do not line up with headings.
blocks gives current usage do not change this.
Exit and save with CTRL k  then x
Exit without saving with CTRL k  then q

To see quota for all users, type: repquota directory_name , eg repquota /home. Check with this after editing.
Any user logged in at the unix prompt can see their quota with the command: show_quota

Viewing and Editing Print Queue and viewing print logs
To list status of all printers:  lpc status | more
To list jobs in queue for a particular printer: lpq -Pprinter_name   eg lpq -Pcopier1
To list jobs in queue for all printers: lpq -a
To remove a  job from a queue first list it with lpq command above to get job number then remove with
lprm -Pprinter_name job_number, eg lprm -Pcopier1 2314
To remove all jobs for a printer: lprm -Pprinter_name -  eg lprm -Pcopier1 -

Logs of print jobs which have passed via print server bell to a networked printer can be viewed in file
/var/log/cups/page_log. It lists the username of the submitter of the job, the originating computer IP address or DNS name the printer name the job was sent to and the time it was sent.

Editing and Creating Mailing lists
Chandler House mailing lists are located in /share3/mailing_lists/ch/. Phonetics and linguistics mailing lists (some are still used) are in /share3/mailing_lists/. They are plain test files. They are activated by adding a line to the file /etc/aliases of format:-
list_name: :include:own/list_name
list_name is the file name containing a list of email alldesses one per line.
A list owner should also be included whose address error messages are sent to instead of to the address sending to the list.
Format of list owner entry is:-
owner-all: mail_address

Example: Entry for all@langsci.ucl.ac.uk

all: :include:/share3/mailing_lists/ch/all
owner-all: ucl_username@ucl.ac.uk

To add an email list:-

This requires editing Unix files. The editors vi, joe and emacs are available for this. The example given uses joe.
log in to bell.phon.ucl.ac.uk as root by first logging in as a user then type su -
At the prompt [root@bell1 ch]#  type:-
cd  /share3/mailing_lists/ch
joe list_name                  You are now editing a new file named list_name  (substitute the name of the desired list for this)
Type in the email addresses for this list one per line.
to exit and save file type CTRL k  then x

At the prompt [root@bell1 ch]#  type:-
chmod username list_name           (username is the username of the person who will maintain this list by editing this file)

type:- 
cd /etc
ls -al aliases*
note the highest number after the files listed beginning with name aliases eg aliases.065

type: cp -p aliases aliases.066     (makes a copy of aliases with file extension one more than last highest)

type:  joe aliases
Find the entry : # End of Chandler House mailing lists
(use CTRL k then f    then enter:  # End of Chandler House mailing lists  then press return twice.)
On the line above this line enter the mail list detains and list owmer in the format above.
Type: CTRL k  then x to exit joe aditor and save file.
or Type CTRL k then q to exit editor without saving.

When a new aliases file has been saved
Type: diff aliases aliases.nnn   where nnn was the file extension number used above for the alias file copy.
Ensure that the output lists only the changes intended to be made to aliases file.

Wen a satisfactory new alias file has veen saved
At the prompt [root@bell1 ch]#  type:-
newaliases.

Test the new list with the command:-
sendmail -bv list_name
For each email address in the list created a line should be displayed:-
mail_address@ucl.ac.uk... deliverable: mailer relay, host mail-smtp.ucl.ac.uk, ...

Access permissions
User's access permissions for files on server bell disks are determined by the Unix permissions on the file or directory, their UID and GID as set in /etc/passwd, their umask set under Unix and in Samba and other group membership as set in /etc/group. If they are connecting via the samba server from a Windows PC then further access permissions may be set in /etc/samba/smb.conf. Unix permissions will overide if they are more restrictive than samba permissions. Both Unix and Samba overide permissions set on a file on a Windows PC then copied to bell. There are also entries here to force a particular group and permissions for any user permitted to write a file via the samba share. Force group is used when more than one user needs to write files to a directory while restricting writes to a particular group.
See Unix manual pages on bell eg type man name. Relevant name may be: chmod, chgrp,  smb.conf, ls