24
Introduction to Linux Installing Linux User accounts and manageme nt Linux’s file system

Introduction to Linux Installing Linux User accounts and management Linux’s file system

Embed Size (px)

Citation preview

Page 1: Introduction to Linux Installing Linux User accounts and management Linux’s file system

Introduction to Linux

Installing Linux

User accounts and management

Linux’s file system

Page 2: Introduction to Linux Installing Linux User accounts and management Linux’s file system

Installing Linux

Follow along as we install SuSE Linux 9.1 professional

Page 3: Introduction to Linux Installing Linux User accounts and management Linux’s file system
Page 4: Introduction to Linux Installing Linux User accounts and management Linux’s file system

Linux Accounts

There is only 1 administrative account in Unix.

This super-user account should not be used on a regular basis as it has unlimited access to the operating system.

Everyone else is consider a regular user account.

Page 5: Introduction to Linux Installing Linux User accounts and management Linux’s file system

Each user account has a username, which is associated with a user id.

Each username and user id must be unique. The OS, however, uses only the user id to

identify the user once the user has logged in. Therefore, you can change your username as

much as you want without much trouble. (Please be aware that some other programs might be dependant on the username.)

Page 6: Introduction to Linux Installing Linux User accounts and management Linux’s file system

Groups

A user may belong to one or more groups.

A group is used to further divide user accounts. (i.e. In university, there might be a math group, a scientist group, etc.)

With groups, you can grant and remove access to certain information to certain groups in the OS.

Page 7: Introduction to Linux Installing Linux User accounts and management Linux’s file system
Page 8: Introduction to Linux Installing Linux User accounts and management Linux’s file system

/etc/passwd

This file “/etc/passwd” stores information of all non-virtual user accounts that have direct access to the OS.

Many programs uses this file to map user accounts to user ids, therefore, this file is usually readable by anyone.

In the old days, the password for the account is also stored in there.

If someone gets a hold of that file, he can find out a user’s password.

Modern day unix systems stores the password in a separate file that’s accessible only by the root user.

Page 9: Introduction to Linux Installing Linux User accounts and management Linux’s file system

In Linux and Solaris, there are two user information files: /etc/passwd /etc/shadow

In BSD Unix (FreeBSD, OpenBSD & NetBSD): /etc/passwd /etc/master.passwd

The later file is the one that contains the encrypted password of all users.

Page 10: Introduction to Linux Installing Linux User accounts and management Linux’s file system

Anatomy of /etc/passwd

An entry in /etc/passwd normally contains the following fields:username:password placeholder:userid:groupid:gecos info:home directory:preferred shell

The /etc/shadow file normally contains the following fields:username:hashed password:last change:expire info

The /etc/master.passwd file for BSD Unix has the following fields:username:hashed password:userid:groupid:login class:last change:expire info:gecos info:home dir:shell

Page 11: Introduction to Linux Installing Linux User accounts and management Linux’s file system

/etc/group

This file stores information about all groups.

Contains the following fields:groupname:password:users belong to the group

The group file’s password field is normally not used as this file is accessible by everyone.

Page 12: Introduction to Linux Installing Linux User accounts and management Linux’s file system

BSD accounts

In BSD Unix, there are two additional versions of the password files.

/etc/pwd.db and /etc/spwd.db They are the hashed versions of /etc/passwd a

nd /etc/master.passwd to allow for a faster username to userid mapping.

In BSD, a user is assigned to a user class, which allows more control of the user. (i.e. how long the user can login, how much resources the user can use, etc.)

Page 13: Introduction to Linux Installing Linux User accounts and management Linux’s file system

Becoming root

As said earlier, you should not be using the root account on a regular basis, so how can you become root without logging off and logging back in as root? (like in windows)

There are two commands to allow you to do things as root: su and sudo

To use it, type “su username” to becoming the other user. su will then ask for the new user’s password. In BSD, you have to be in the wheel group to become root.

The sudo command allows certain users to do certain tasks. (i.e. Allow user foo to install programs.)

If foo is allow to use the program bar, then foo types “sudo bar” to use the program bar.

sudo will then ask for your password, not the root password.

Page 14: Introduction to Linux Installing Linux User accounts and management Linux’s file system
Page 15: Introduction to Linux Installing Linux User accounts and management Linux’s file system

Unix’s Filesystem

There are many file systems for Linux: Extend 2 Extend 3 Reiser

Extend 2 is the traditional linux file system, the newest one is the reiser file system.

Reiser fs provides security features like encryption.

BSD and Solaris uses the Unix File System, which is also named the Fast File System.

UFS is the original unix file system developed by BSD of course. Modern UFS also supports encryption.

Page 16: Introduction to Linux Installing Linux User accounts and management Linux’s file system

In addition, there is a Network File System for network access.

NFS is a virtual file system that works with the native file system.

Page 17: Introduction to Linux Installing Linux User accounts and management Linux’s file system

All unix variants should be able to write to any of the file systems each variant uses.

They can also write to the old windows DOS FAT and FAT32 file systems.

For NTFS, windows’ latest fs, all unix variants can read from NTFS.

There are experimental drivers out there that allows writing to NTFS.

Page 18: Introduction to Linux Installing Linux User accounts and management Linux’s file system
Page 19: Introduction to Linux Installing Linux User accounts and management Linux’s file system

File system hierarchy

The unix has a tree structure to organize its files.

The top level is the “/” directory. Under this directory, you’ll often see:

/etc /usr /bin /sbin /home /var /tmp

Page 20: Introduction to Linux Installing Linux User accounts and management Linux’s file system

/etc Stores system configuration files, password information

/usr Stores user install programs and their configuration files

/bin Base programs that are necessary for unix to boot up.

/sbin Like /bin, but programs that only root are supposed to have access t

o. /home

Stores all user accounts /var

Stores variable data, such as user email, a database. /tmp

Stores temporary files.

Page 21: Introduction to Linux Installing Linux User accounts and management Linux’s file system

Normal setup

Normally, the /usr, /var, /tmp and /home would be a separate partition so that quotas might be enforced.

For a home user setup, you may have /home in a separated partition and everything else in 1 partition.

Page 22: Introduction to Linux Installing Linux User accounts and management Linux’s file system

Swap file

The swap file is virtual memory from the hard drive.

Windows creates this virtual memory automatically and can be adjusted through the system settings.

On unix, you have to create 1 or more swap file or unix will not function.

Page 23: Introduction to Linux Installing Linux User accounts and management Linux’s file system
Page 24: Introduction to Linux Installing Linux User accounts and management Linux’s file system