Maintaining Your Account
Once you have obtained an account, you will be responsible for maintaining your account. This includes making sure that your account remains below its size quota, and that the correct permissions have been applied to your files. You will also find that many aspects of your account can be customized. Your password, permissions, login, shell, etc. can all be changed to enhance your productivity. The following lists several ways that these changes can be executed. All commands will need to be run on a Unix system in a console/terminal such as access.cims.nyu.edu.
- To change your password
- To change your shell
- Diskspace Quotas
- Dot files and directories
- Useful Unix Commands
To change your password, use the following command:
You will then be prompted for your current login password, to verify that you are the correct user. After verification, the shell will ask for the new password that you would like to change to.
To change your shell, use the following command:
You will then be prompted for your current login password, to verify that you are the correct user. After verification, the shell will show you your current shell and prompt you for the new one. Once the change has been made you may have to wait up to five minutes and log back in to see the changes take effect.
Valid shells are:
Note: chsh could report "Segmentation Fault" after you make the change. This is a bug in Sun's implementation. Do not be alarmed; your shell was changed successfully.
Your personal computing environment is defined by how it interacts with the global computing environment, which in turn is defined by the software available on a given machine.
The interaction of your personal environment with the general environment is customizable and such customizations are often defined in what, under Unix, are called dot files and dot directories. Such files and directories do not normally show up when one executes a plain ls command. To get a listing of all dot files use:
Many software packages make use of dot files and dot directories to define variables that control their behavoior. If a piece of software makes use of them, it probably does so in one or a combination of the manners listed below.
- It creates a dot file or dot directory when first invoked.
Example: netscape creates a directory called .netscape when first invoked.
- It looks for a dot file or dot directory in your home directory first, then looks for a global dot file (which often does not start with a dot) and uses that if the one in your home directory ($HOME) does not exist.
- Makes use of environment variables set in another dot file that does not specifically have to do with that piece of software.
Example: see /usr/local/lib/.cshrc
Dot files and dot directories are often named after the software they are related to and the most important of these relates to the shell under which all other software is run. The default shell for all new accounts is set to csh and its behavior can be customized in a file called .cshrc where you will also find many of the environment variables that relate to other software packages.
Another important dot file is your .login file and it is important to understand the order that they are read when logging in (.cshrc is processed first). Since the .cshrc file is read every time a new shell is invoked and your .login file is not, it is generally safer to set all your environment variables in .cshrc and reserve .login for starting up a windowing system or setting a terminal type.
Keeping your dot files up to date:
All new accounts are given a standard set of dot files and it is probably a good idea to check /usr/local/lib/dots from time to time. It is not advisable, however, to replace (or edit) an existing dot file without first making a copy of the original.
In the interest of keeping everyone's computing environment up to date, your .cshrc first sources a global .cshrc in /usr/local/lib. If you wish to change any settings set in the global .cshrc, it is highly recommended that you do so by overriding them after the global one is sourced as opposed to eliminating the sourcing of the global one altogether. Similarly, your .login also sources a global .login. However, since the .login requires one to make choices, such as choosing a windowing system, it should not be overridden by adding choices before or after the global one is sourced, but instead, should be replaced by one of your own creation.
The UNIX system provides a number of ways in which one can customize access to files and directories. The ls -l command will show you current permissions on files and subdirectories.
Permissions are grouped by user, group, and others respectively. These can be modified by the chmod command. The two methods for using this command are Absolute Mode, and Symbolic Mode:
- Absolute Mode
Absolute mode uses an octal(base-8) system to represent different permissions.
chmod 0751 fileThe first number sets all permissions on the directory, the second number sets permissions for the owner/user, the third number on groups, and the last number on others. For the above example, the user then has all permissions granted, anyone in the same group can read or execute, while others can only execute.
- Read = 4
- Write = 2
- Execute = 1
- Symbolic Mode
Symbolic mode has the exact same effect as the absolute mode, except that it uses letters instead of numbers.u = user, g = group, o = others, a = allThe correct syntax using symbolic mode would be:
'+' to add, '-' to take away, '=' to assignchmod go+rx fileThis example would add read and execute capabilities to both the group and others.
Other Options: Set User ID, Set Group ID, and the Sticky Bit
In certain cases, you may wish a file to be accessible at certain times only. Perhaps you run a program that accesses a file to read, write, or execute, however, you want to have permissions only when this program calls the file. Setting ID's in these cases can then be a useful option.
chmod 2000 file will set the group ID
This will give whoever is accessing the file temporary permissions upon execution. In addition, directories that have the group ID set will give new files and subdirectories the permissions of the parent directory, not that of the current process.
The sticky bit acts as a restriction on directories in which groups or others can write. Only the user or super-user can set the sticky bit. If a directory can be written to by others or groups and the sticky bit has been set, files can be created, but the only people that can remove or rename the file are when:
- the user owns the file
- the user owns the directory
- the file is writeable by the user
- the user is a privileged user
There is a lot of documentation regarding the chmod command. Try either the man pages, or the web.
The Systems Group maintain tape backups of your home directory. We also maintain up to 2 nights of snapshots on disk. These snapshots are accessible in the new and old directories under ~/.zfs/snapshots. The new directory is a snapshot of your home directory taken the night before (or early morning of the same day), and the old directory contains the snapshot taken two nights ago. If you have just changed/deleted a file and would like to recover a version from up to two days ago, you may find it in one of the snapshot directories. To request a retore of older files from tape archives, please contact email@example.com.