# Keeping Your Computer Safe

&legalnotice;

This section describes how to keep your computer safe from security threats.

## Passwords

Keep your password safe. If you want to change it, you can by opening About Me (&about-me;) and clicking Change Password.

It is possible to automatically login to Ubuntu.

Automatic login is highly discouraged because it provides less security for your system.

1. Open &login-screen-setup;.

2. Press Unlock and type your password to unlock the settings

3. Check Login as.

4. Choose a username from the drop down list to login as.

5. Press Close.

6. Changes will be applied on re-boot.

## Give a separate user account to each person

When Ubuntu is installed, it is set up for a single person to use. If more than one person will use the computer, it is best for each person to have their own user account. This way they can have separate settings, documents, and other files. If necessary, files can also be protected from being viewed or changed by non-administrators.

To set up user accounts, choose &users-groups;. You must be an administrator to do this.

See the Users Administration Tool manual for more information on setting up user accounts.

## Keep your software up to date

Ubuntu developers often issue updates to the Ubuntu software. These updates may improve security or fix other problems.

When security updates are available, the Update Manager automatically starts up. For other updates you will be prompted once a week. To install updates, just click Install Updates and enter your password when prompted.

The update process may take a while if many updates need to be installed.

If a pair of blue arrows appears in the panel when the updates have finished, you need to restart the computer to complete the installation.

To check for updates yourself, choose &update-manager; and press Check.

To change how often Ubuntu checks for updates, or to set updates to install or download automatically, choose &software-properties;, and then Updates.

## Lock your screen while away

Locking your screen prevents other people from accessing your computer while you are away from it. All of your applications and work remain open while the screen is locked, and the screensaver is displayed.

You can lock your screen in one of the following ways:

- Click the User Switcher in the top right of the panel and then press Lock screen.

- Press Control Alt L to lock the screen. This keyboard shortcut can be changed in &keyboard-shortcuts;.

You can add a Lock Screen button to a panel for easy access. Right-click a panel (for example, the panel at the top of the screen), select Add to Panel... and drag the Lock Screen item to the desired location.

To unlock the screen, move the mouse or press a key. Then, type your password and either press the Enter key or press the Unlock button.

If more than one person has a user account on your computer and the screen is locked, other users can press the Switch user... button to use the computer, even while the screen is locked. They will be unable to access your currently-open work, and you will be able to switch back to your locked session when they have finished using the computer.

## Set up a firewall

You may wish to install a firewall to protect your computer against unauthorized access by people on the Internet or your network. Firewalls block connections to your computer from unknown sources, which helps to prevent security breaches. If you use a router to connect to the Internet, the router may already have a firewall configured which regulates connections from the Internet to your network. This section deals with setting up a firewall on Ubuntu to regulate connections to your computer.

### Firewall configuration tools

Uncomplicated Firewall (UFW) is the standard firewall configuration program in Ubuntu. It is a command line program. Most users will prefer to use Gufw, which is a graphical program to configure UFW.

Advanced users may wish to use UFW directly in the terminal. See the UFW manual or the Community Documentation page on UFW for more information. Alternatively, you can use iptables - see the iptables manual.

#### Gufw

To install and enable Gufw:

- Install the gufw package.

- To start Gufw, choose &gufw;.

- To enable the firewall, simply check the box next to Enabled under Actual Status.

The default configuration is to deny connections. This means that a program attempting to connect to your computer will be denied. Certain programs or services which use the internet may require you to add an exception.

To add an exception:

- Click Add.

- You can choose from Preconfigured options for common programs and services, or you can manually add port exceptions in the Simple or Advanced tabs.

- To find out what type of exception a particular program requires, you should consult the help for that program.

For a graphical walkthrough of basic Gufw usage, see the Ubuntu Community Documentation page on Gufw.

### Testing the firewall and monitoring network traffic

To test the firewall it is best to scan it from a second computer. A popular application to use is called nmap.

- Install the nmap package.

- Run:

      nmap -vAPN 192.168.1.100

  Substitute the IP address of the computer you want to scan for 192.168.1.100.

- To see what services are associated with the open ports, run:

      lsof -i -n -P

You can also make use of an online firewall testing service such as ShieldsUP.

Actual monitoring of your network traffic can be done with either Wireshark or Snort. Wireshark can analyze network packets and Snort is used in Network Intrusion Detection Systems (NIDS) and will notify you of unusual traffic.

## Avoid Internet nuisances and crime

From time to time, you may be sent an email which carries a virus or links to a fraudulent website. This type of email is very common, and it is important to learn how to deal with it, in order to prevent your computer or your personal details from being compromised or misused.

Such messages are often received from total strangers. However, sometimes an email may appear to be from someone you know, when really it is not. This is because it is possible to include a fake sender email address in emails.

Unwanted (unsolicited) mail tends to fall in to one of several categories:

- Spam (junk) email, where people offer unwanted services and products

- Scam emails, where people pretend to ask for help in exchange for large sums of money

- Phishing email, where the message appears to be from a bank or other online service, asking you to enter your personal and financial details, or passwords.

Below are some tips for keeping safe online:

- You should never reply to unsolicited mail, or even click on the links in the mail. Doing so usually results in more junk mail being sent to you.

- Never click on links in emails which lead to websites asking for your password or similar. It is possible for the text of the link to give one address, when really it opens up another (possibly dangerous) address. Instead, type the link into your web browser yourself and proceed from there.

- If a website asks for your financial details, ensure that it is secure. In the Firefox Web browser, secure websites have a blue background surrounding the icon to the left of the address bar. Additionally, the site name and a padlock icon are displayed in the lower-right corner of the browser window. Click on the padlock to read more information about the security of the website.

- Only download and run software from sources that you trust. By default, you can only download software directly from Ubuntu.

## Make backup copies of your files

A problem which you may occasionally encounter is the unexpected loss of some of your work and settings for one reason or another. The causes of such data loss are many and varied; it could be anything from a power cut to accidentally deleting a file. It is highly recommended that you make regular back-up copies of your important files so that, if you do encounter a problem, you will not have lost those files.

It is wise to store back-up copies of files separately from your computer; that is, you should make use of some form of file storage which is not permanently attached to your computer. Options include:

- Writable CDs and DVDs

- External hard disks and flash memory devices

- Another computer on the network

A simple way of backing-up your files is to manually copy them to a safe location (see above) by using the File Browser.

Alternatively, you can use a dedicated back-up application, such as Simple Backup Suite.

- Install the sbackup package from the Universe repository.

- To make a backup, press &sbackup; and enter your administrator password when prompted.

- Under General tab, choose backup mode which you would like to use. If you are not sure what you should backup, select Use recommended backup settings. This will perform daily incremental and weekly full backup of all user and system files to `/var/backup` default directory, excluding multimedia and temporary files as well as files larger than 100 MB.

- Press Save to save your settings.

- If you want to backup your files immediately, then press Backup Now!; otherwise, click Close button to leave the scheduled backup.

- Your backup will launch in the background and you will see pop-up window with information about process id. Click Close. The backup process may takes a while, depend on amount of copied files.

- Your backup will be placed as directory into `/var/backup`. You must be an administrator to access your backup.

The Simple Backup Suite does not provide an option to write backup files directly to CDs or DVDs. You have to write backup manualy using for example a Brasero Disc Burning software (&brasero;). Alternatively you can customize Simple Backup Config to backup your files into another place (eg. remote server or external drives). See community help wiki for details how to use Simple Backup Suite software.

To restore a backup made with Simple Backup Config, press &sbackup-restore; and select restore source folder and available backups from drop-down menu. Choose the files and folders you want to restore, click on the Restore button and confirm your choice. If you want to restore in a different location you need to select the Restore As option.

By default, restored files and directories are owned by root. This is because Simple Backup Suite runs with root priveleges. You need to change these file or folder permissions using File Browser.

Some general advice on how to keep good back-ups is given below:

- Back-up on a regular basis

- Always test your back-ups after you make them, to ensure that they have been made correctly

- Label your back-ups clearly, and keep them in a safe place