Basic Linux Admin - PowerPoint PPT Presentation

1 / 20
About This Presentation
Title:

Basic Linux Admin

Description:

etc : host-specific configuration files /home: user home directories ... the file/directory name. The permission argument for chmod. chmod ... – PowerPoint PPT presentation

Number of Views:17
Avg rating:3.0/5.0
Slides: 21
Provided by: skh3
Category:

less

Transcript and Presenter's Notes

Title: Basic Linux Admin


1
Basic Linux Admin
  • Tasks of Linux admin
  • managing hardware
  • managing the kernel
  • managing filesystems
  • managing user account
  • managing network and security
  • managing backup/installation/archiving

2
Basic Linux Administration
  • Reference Guide
  • System Administration
  • File System Structure
  • Boot Process, Init and Shutdown
  • The ext3 File System
  • Network Administration
  • TCP Wrappers and xinetd
  • Network Scripts
  • Firewalling with iptables

3
File System in Linux
  • Built-in hierarchical file structure
  • Common directories
  • /bin essential command binaries which may be
    used by the system administrator and by ordinary
    users, required for system boot
  • /boot kernel image and configuration files used
    by boot loader
  • /dev device files
  • /etc host-specific configuration files
  • /home user home directories
  • /lib essential shared lib and kernel modules

4
File System in Linux (2)
  • /mnt mount point for temporarily mounting files
    system such as those on a CDROM or floppy disk
  • /opt add-on application software packages
  • /root the root users home directory
  • /sbin system binaries, essential for system
    administration, but not for system boot
  • /tmp location of temporary files
  • /usr secondary hierarchy, intended as sharable,
    read-only data
  • /var variable data such as spool directories
    log file

5
File system
  • in unix, a filesystem is some device that is
    formatted to store files. It can be found on hard
    drives, floppies, CD-ROMs and others
  • the exact format and means the files are stored
    are not important
  • based on second extended filesystem, ext2fs
  • provide a common interface for all filesystem
    types that it recognizes

6
Ext3 file system
  • In Linux 7.2, ext2 is the default file system
  • Require check for consistency (e2fsck) when
    system is not properly shut down
  • Ext gt ext2 gtext3
  • Support 256 char filenames, 4 Tbyte max filesize
  • Others MS-Dos, FAT32, NTFS, ISO9660
  • Starting from Linux 7.3, ext3 is the default file
    system
  • Provide stronger data integrity in event of
    unclean shutdown
  • Check for consistency is needed only on rare
    hardware failure
  • Higher throughput, as it is optimizes hard drive
    head motion
  • Provide easy transition from ext2 to ext3
  • other common filesystem are MS-DOS (FAT32, NTFS,
    ISO9660)

7
Creating user account
  • manage users and group accounts and related
    system files
  • passwd and group
  • user account information is stored in /etc/passwd
  • each line in /etc/passwd contain a username,
    password, UID, GID, users name, home directory
    and default shell
  • group information is stored in /etc/group
  • each line in /etc/group contain a group name,
    group password, GID and group member list

8
Creating user account
  • to prevent users from obtaining encrypted
    passwords from passwd and group, show files are
    implemented
  • encrypted passwords are moved to a new file,
    which is readable only by root
  • the shadow file for /etc/passwd is /etc/shadow
  • the shadow file for /etc/group is /etc/gshadow

9
Creating user account
  • Three methods
  • modify the files directly, not recommended
  • Login in as root
  • Create a record for the user in /etc/passwd
  • Set the users password
  • Specify a login shell for the user
  • Create a home directory for the user
  • Use command line
  • useradd -D -g default_group -b default_home
    -s default_shell
  • Donaldx503503unka Donald home/donald/bin/bas
    h
  • Alternatively, use GUI (most recommended)

10
Daemon
  • Commands to works with networks and system
    resource
  • Must be continuously running a server process in
    the background, waiting to handle the users
    request
  • Example
  • named - translates numeric IP addresses into the
    alphanumeric names
  • lpd - sends documents to a printer, over a
    network
  • ftpd - allows you to connect to another machine
    via ftp

11
configuration files
  • bash uses a number of configuration to set its
    operating environment when it starts
  • /etc/profile
  • system wide initiation files, execute during log
    in, contains environment variables, such as
    initial PATH, and startup program
  • /etc/bashrc
  • system wide initiation files for a user, contains
    alias

12
/etc contains host-specific configuration files
  • /etc/login.defs
  • /etc/conf.modules
  • /etc /printcap
  • /etc /x11/xdm
  • /etc /x11/fs/config
  • /etc /inittab
  • /etc /x11/twm/system.tmw
  • /etc /exports
  • /etc /hot.conf
  • /etc /nsswitch.conf
  • /etc /network
  • /etc/inetd.conf
  • /etc/host.allow
  • /etc/host.deny
  • /etc/sendmaicf
  • /etc/rc.d
  • /etc/rc.sysinit
  • /etc/rc
  • /etc /init.d
  • /etc /rc0.d
  • /etc /rc1.d
  • /etc /rc2.d
  • /etc /rc3.d
  • /etc /rc5.d
  • /etc /rc6.d
  • /etc /bashrc
  • /etc /profile
  • /etc/fstab

13
File Permission
  • Every file and directory in UNIX/Linux has read,
    write, and execute permissions.
  • Read permission means that the file can be read
    but not modified or deleted
  • Write permission means that the file can be
    created, modified, or deleted
  • Execute permission means that the file can be
    executed.

14
who use the files?
  • There are 3 sets of permissions for every file or
    directory -- owner, group, and others
  • The owner permissions are for the owner of the
    file or directory
  • The group permissions are for everyone in the
    group
  • Others The global permissions are for anyone
  • What is the command to see the permission and who
    own the files?
  • ans ls -l

15
chmod
  • r -- file can be read
  • w -- file can be written and modified
  • x -- file can be executed (if it is a program)
  • chmod is a standard command that allows you to
    change the permissions of a file or directory.
  • There are two arguments for chmod
  • the permissions based on numbers
  • 1 stands for execute.2 stands for write.4
    stands for read.
  • the file/directory name. The permission argument
    for chmod.

16
chmod
  • chmod 777 lab2file will allow EVERYBODY full
    access to read, write and execute.
  • chmod 644 lab2file will all the owner (you) read
    and write access, the group read access, and
    everybody else (world) read access too.
  • chmod 700 lab2file will give yourself full access
    while giving everybody

17
Quiz 1
  • Which of the following commands can be used to
    check an ext2 filesystem?
  • a fsck -ext2 /dev/hda5
  • b fsck /dev/hda5
  • c e2fsck /etc/hda5
  • d fsck.ext2 /dev/hda5
  • e fsck.linux /dev/hda5

18
Quiz 2
  • Of the following directories, which one is most
    important to back up on a routine basis?
  • a /var
  • b /tmp
  • c /usr
  • d /root
  • e /etc

19
Quiz 3
  • Which one of the following commands would be best
    suited to mount a CD-ROM containing a Linux
    distribution, without depending on any
    configuration files?
  • a mount /dev/cdrom /dev/hdc
  • b mount -f linux /dev/hdc /mnt/cdrom
  • c mount -t iso9660 /dev/cdrom /mnt/cdrom
  • d mount -t linux /dev/cdrom /mnt/cdrom
  • e mount -t iso9600 /mnt/cdrom /dev/cdrom

20
Quiz 4
  • User jode, a member of finance group, owns a text
    file with group owner finance and mode 0077.
    Which statements are true regarding access to
    view the contents of the file, assuming the
    directory that contains it has mode 0777? Select
    all that apply.
  • a. jode can view files contents
  • b. jode can first change the protection mode of
    the file and then view the files contents
  • c. root cannot view the files contents
  • d. Everyone in the finance group can view the
    files contents except jode
  • e. Everyone in the finance group can view the
    files contents including jode
Write a Comment
User Comments (0)
About PowerShow.com