模板:U Lucid/Administration
User Administration
- System -> Administration -> User Management -> Administrator Mode
Add New Users
- "New" button
- Change the "Login Name" to the desired username
- Click the "Passwords and Security" tab
- Enter the desired password
Modify Users
- Select the user you wish to modify
- Click the "Modify" button
Removing Users
- Select the user you wish to remove
- Click the "Delete" button
Change your user groups
It is quite often necessary to have extra privileges to do certain tasks. These privileges are assigned to your user by belonging to certain groups. The tasks are allowed to be performed by any user belonging to the group associated with that task.
- Example: a "sudoer" is a user who can perform certain administrative tasks, such as updating the system. To become a "sudoer" a user must belong to the "sudo" group.
- Applications menu -> System -> User Manager -> user -> Groups --> check sudo
To become an administrator, you must belong to the adm, admin, and sudo groups. To be a virtualbox user, you must belong to the virtualbox group. To change printer settings you must belong to lpadmin. To use the cdrom, you must belong to cdrom. To use hot-pluggable devices, you must belong to plugdev. To share Samba folders (on a Windows-based network), you must belong to sambashare. To access NTFS files using the virtual filesystem fuse, you must belong to the fuse group. To use many games, you must belong to the games group. The list is long, and not always obvious.
Unfortunately, while this is the feature that gives Linux such a high-level of security, it can also take diligence to remember to add your user to certain groups. It is not uncommon for programs and functions on your system not to work merely because you don't have privileges to do so because you forgot to add your user to the appropriate group(s).
Of most importance, you must already be an administrator in order to change membership in groups. Therefore, if you create a new user and intend to give that user administrative privileges (by assigning the user to the administrative groups), you must do so from your original administrator account (the one you set up at installation) or from another administrative user account.
Timekpr (Parental controls)
Timekpr is a program to track and control the computer usage of user accounts.
- If updating, remove any prior versions:
sudo dpkg --purge timekpr
- Add the timekpr third-party repositories:
sudo add-apt-repository ppa:nedberg
- Install:
sudo apt-get install timekpr
- When prompted which default display manager to use, select "gdm"
- Start:
- System -> Administration -> Timekpr Control Panel
Web content filtering
DansGuardian provides web filtering capability, similar to NetNanny. It is useful for limiting objectionable content in publicly accessible workstations, or for filtering objectionable content for younger users. It integrates with ClamAV, and uses several criteria for filtering websites (which is difficult to modify). It is used with Tinyproxy (best for individual users) or the Squid proxy (best for a network server). Install:
sudo apt-get install dansguardian tinyproxy
- or
sudo apt-get install dansguardian squid
See these installation instructions for setup details. In brief,
- Edit the dansguardian configuration file:
sudo nano /etc/dansguardian/dansguardian.conf
- comment out the UNCONFIGURED line:
#UNCONFIGURED
- If using tinyproxy instead of Squid, change the proxyport to 8888:
proxyport 8888
- Reinstall dansguardian:
sudo apt-get install --reinstall dansguardian
- Set your browser to use the localhost:8080 proxy. For example, in Firefox:
- Firefox -> Edit -> Preferences -> Advanced -> Network -> Settings
- Manual proxy configuration -> HTTP proxy: localhost -> Port: 8080
- A Webmin module is available to administer settings. Also, a GUI to change Dansguardian settings called Webstrict is in development.
- A GUI for use with IPCop (based on the webmin module) is also available.
System Administration
Automating Tasks
- Tasks (cron events) can be automated/scheduled using the GNOME schedule GUI interface.
- System -> Administration -> Task Scheduler
- If the GNOME Schedule task scheduler is not installed, install it:
sudo apt-get install gnome-schedule
Boot Menu
Login Menu settings
You can change the Login menu settings from the GUI interface:
- System -> Administration -> Advanced -> Login Manager
You can choose an integrated theme or select individual components of the login screen/process.
Automating bootup options
StartUpManager is a GUI to manage settings for Grub (Grub Legacy), Grub 2, Usplash, and Splashy.
- Install:
sudo apt-get install startupmanager
GRUB boot manager settings
Grub2
Lucid comes with Grub2, which is a difficult boot manager to customize. See the evolving instructions at the Ubuntu wiki or Ubuntu forums. In brief, some settings can be edited:
sudo nano /etc/default/grub sudo update-grub
- You can also use this command:
sudo grub-mkconfig --output=/boot/grub/grub.cfg
Legacy GRUB
You can install the older version of GRUB ("GRUB Legacy") if you are using it on a boot partition, for example. Install:
sudo apt-get install grub
- If you have multiple operating systems (OS) on your computer, you are likely using a GRUB Legacy boot manager to select which one to start at bootup. You can edit the options for GRUB from a GUI interface:
- System -> Administration -> Advanced -> GRUB Editor
- To edit the settings manually from the command line Terminal:
sudo nano /boot/grub/menu.lst
Default Applications
You can choose which program to use as your default program for a specific task.
- System -> Administration -> Default Applications
Kill a process
Sometimes a program (or "process") just freezes. To "kill" (or end) the program/process:
- System -> Administration -> System Monitor -> highlight the errant process -> Kill process
Enabling NUM LOCK On Startup
- System -> Administration -> Keyboard & Mouse -> Keyboard ->"turn on Numlock on Startup"
Working with Menus
Create an encrypted folder
You can create a folder whose contents are encrypted. See these instructions.
Create a symlink from a file to another location
ln -s /path/to/source /path/to/destination
If /path/to/destination require superuser rights, use:
sudo ln -s /path/to/source /path/to/destination
This is similar to, but more powerful than, creating Shortcuts, with which former Windows users may be familiar.
Assign a root password
To be able to log in as root directly, you must assign a root password. This can be done with:
sudo passwd root
Afterwards, you can use
su
to get a root prompt. You would then use the root password.
Get a root prompt without using a root password
If you have not set a root password (or don't know it), you can obtain root user privileges anyway. From the command-line Terminal:
sudo -s
- or
sudo su
- or
sudo bash
You will use your own user password instead of a root password.
You could also get a prompt to become any other user on the computer by typing:
sudo su <username>
Use the File Manager as root
sudo nautilus
- or
gksudo nautilus
Manually Mount and Unmount a device
To manually mount a device:
mount /dev/hda
replace /dev/hda with the location of the device.
To manually unmount a device:
umount /dev/hda
replace /dev/hda with the location of the device.
Windows Compatibility
Mounting NTFS Partitions (with read/write privileges)
Find out the name of your ntfs partition:
sudo fdisk -l
Method 1: In this example, the NTFS drive is listed by fdisk as /dev/sda2, but yours may differ.
Make a mount point for the drive:
sudo mkdir /media/WindowsNTFS
Edit fstab:
sudo nano /etc/fstab
Comment out the automatically added lines by Ubuntu installation:
#/dev/sda2 auto nouser,atime,noauto,rw,nodev,noexec,nosuid 0 0 #/dev/sda2 /mnt auto user,atime,noauto,rw,nodev,noexec,nosuid 0 0
and instead add the line:
/dev/sda2 /media/WindowsNTFS ntfs-3g quiet,defaults,rw 0 0
Note: There are many ways to mount the drive, depending on your needs. The fstab file controls this process. See How to edit and understand fstab and Intro to using fstab.
In this example, I indicated that the file system was an ntfs-3g filesystem, so did not use the auto option (which detects the filesystem automatically). I used rw to specify read/write privileges for all users, but umask=0 and umask=000 are accepted by some kernels.
Method 2:
Edit fstab:
sudo nano /etc/fstab
When Ubuntu installation finishes, it mounts all ntfs partitions automatically with ntfsprogs, adding a line similar to the following to fstab:
UUID=8466268666267956 /media/sda1 ntfs defaults,gid=46 0 1
Change this line to:
UUID=8466268666267956 /media/sda1 ntfs-3g defaults,nls=utf8,locale=zh_CN.UTF-8,rw,gid=46 0 1
In this example, I have a Chinese-language Windows installation on my first partition, so I set the locale parameter (locale=zh_CN.UTF-8) so that my Chinese documents can display correctly. Setting rw (same as umask=0 or umask=000) lets me read/write the partition without sudo. gid=46 specifies that the drive will belong to the group of hot-pluggable devices (plugdev) and is not necessary unless your ntfs drive is a hot-pluggable one (such as an external USB drive). nls=utf8 is the default and is optional for most ntfs users, but there are other options for Chinese (and other specialized character-set users).
Mounting FAT32 Partitions
Follow the above instructions, but use vfat instead of ntfs-3g.
In other words, if you have made a mount point directory /mnt/WindowsFAT32 and your FAT32 drive is /dev/sda3, then edit the /etc/fstab file to include the line:
/dev/sda3 /mnt/WindowsFAT32 vfat quiet,defaults,rw 0 0
Synchronize clock to network time server
The Network Time Protocol (NTP) allows time synchronization of your computer to time servers on the Internet.To enable it:
- Applications menu -> System Settings -> Date & Time
- Check the "Set date and time automatically" option
- Choose an ntp time server near you.