Unix Notes - PowerPoint PPT Presentation

About This Presentation
Title:

Unix Notes

Description:

Create home directory (mkdir /home/smith) Set password (passwd) ... To delete: reverse the above, remove entries from /etc/passwd, /etc/shadow and /etc/group. ... – PowerPoint PPT presentation

Number of Views:150
Avg rating:3.0/5.0
Slides: 33
Provided by: stank6
Learn more at: http://crab.rutgers.edu
Category:

less

Transcript and Presenter's Notes

Title: Unix Notes


1
Unix Notes
  • System Administration

13
2
Basic System Admin Tasks (As Before)
  • Account Management (add, delete, change
    passwords)
  • Startup and Shutdown
  • Monitor System
  • Disk Administration
  • Memory Management
  • Security and Backups
  • Job Management
  • Networking
  • Install/Upgrade Hardware and Software
  • Services Management (email, web, etc..)
  • Etc. Same list as with Windows Admin.

3
Basic Installation Steps
  • Have 3 Red Hat Linux CD (no boot floppy disk)
  • Reboot System off of the CD
  • Select Language, Keyboard and Mouse configuration
  • (taking defaults often works best, since linux
    probes the hardware for correct defaults)

4
More Installation .
  • Disk Partitioning
  • Choose Boot Loader
  • Network Configuration (hostname, ip address,
    subnet mask, default gateway, dhcp, dns, etc..)
  • Firewall Configuration
  • Time Zone selection

5
And more installation..
  • Set root password (root is the unix
    administrators account)
  • Pick software packages to install
  • Formatting of Hard drive Occurs
  • Installation of software Occurs from CD to hard
    drive
  • Create boot disk?
  • Configure monitor and graphics card

6
Last Installation Slide
  • Reboot
  • Setup User Accounts
  • Set Date and Time
  • Finished!
  • (you can now sign on as root or any other
  • account you created above)

7
Account Creation/Deletion
  • Manual
  • Edit /etc/passwd, /etc/shadow (if it exits),
    /etc/group (maybe)
  • Create home directory (mkdir /home/smith)
  • Set password (passwd)
  • Copy config files to account, from /etc/skel
    (like .cshrc, .login, .emacs, etc..)
  • Check permissions (chmod), ownership (chown) and
    group (chgrp)

8
  • To delete reverse the above, remove entries from
    /etc/passwd, /etc/shadow and /etc/group. Erase
    home directory and files within. Erase mail
    spool area (/var/spool/mail).

9
Gui Tools
  • Solaris - admintool
  • Linux - (linuxconf under RedHat linux 5.x)
  • User Manager under RedHat Linux 7.x
  • Start ? System Settings ? Users and Groups (
    Under RedHat Linux 9)

10
  • /etc/passwd file - one line per account (user and
    system accounts)
  • fields separated by colons
  • username (1-8 characters)
  • password - encrypted
  • uid - user id number, integer
  • gid - group id number, integer, related to
    /etc/group
  • general info field
  • home directory
  • shell (/bin/sh /bin/bash /bin/csh /bin/tcsh)

11
example (from clam)
  • trleex7104842000Tracey Lee/clam/u2/students/
    trlee/bin/tcsh
  • jlamelasx7104942000joselamelas/clam/u2/studen
    ts/jlamelas/bin/tcsh
  • traceypx7105042000Tracey Pino/clam/u2/student
    s/traceyp/bin/tcsh
  • pwconv - tool to convert /etc/passwd to
    passwd/shadow combo

12
  • /etc/shadow file - one line per account (user and
    system accounts)
  • fields separated by colons
  • username (1-8 characters)
  • Encrypted password
  • other misc. fields (may not be used), mainly for
    password/account expiration
  • Ex
  • smithZZ/rpaXz!2wi.Cw
  • stanab2393.!xy!!.CW3

13
  • /etc/group file - one line per group name
  • fields separated by colons
  • Groupname (1-8 characters)
  • Optional group password (not often used)
  • Group ID number (integer number)
  • List of users in the group (comma separated)
  • Ex.
  • root0root,adm
  • sys3root
  • staff1000stan,megan,rachel
  • users2000nixon,carter,bush,clinton,washington

14
Basic unix commands
  • date
  • cp file1 file2
  • mv file1 file2
  • mv file1 directory1
  • vi filename
  • emacs filename
  • pico filename
  • more filename
  • cat filename
  • chown username file
  • chgrp groupname file
  • chmod ugorwx filename
  • echo PATH
  • ls
  • ls -lg
  • man ls
  • pwd
  • cd
  • cd ..
  • cd .
  • cd /usr/ local
  • passwd
  • mkdir directoryname
  • rmdir directoryname
  • rm filename

15
  • start-up-files (in ones account)
  • .login .cshrc .bashrc .xinitrc .emacs
    etc..
  • (use ls al to see all files, even hidden/.dot
    files)

16
3. File System/Partitions
  • Typical Partitions
  • / (root, contains everything that is not in the
    other partitions, like /etc /dev etc..)
  • /usr (system files)
  • /var (log files and spool area)
  • /home (home directories)
  • Other partitions partitions particular to linux
  • /boot (boot info)
  • /services (for email, web, and other services)
  • swap (swap space)

17
  • Can have more partitions, or less (at least 2 are
    needed, swap and root). The above is typical.
  • Each of the above is associated with a partition
    on the hard drive, like /dev/hda1 /dev/hda2
    and can be seen with "df" or "mount" or look at
    the contents of /etc/fstab.

18
Df and Mount commands
  • df (Disk Free)
  • On clam (df k)
  • Filesystem kbytes used avail capacity
    Mounted
  • /dev/hda1 962571 437769 467048 49 /
  • /dev/hda2 . . . 80
    /usr
  • /dev/hda3 . . . 21
    /var
  • /dev/hdb1 . . . 63
    /home
  • Etc

19
DF and Mount Commands
  • mount
  • / on /dev/hda1 read/write/logging on 3/1/04
    740am
  • /usr on /dev/hda2 read/write/logging on 3/1/04
    740am
  • /var on /dev/hda3 read/write/logging on 3/1/04
    740am
  • /home on /dev/hdb1 read/write on 3/1/04 741am
  • /test on /dev/hdb3 read on 3/10/04 1100am
  • Etc

20
Processes (jobs)
  • ps (just view your own jobs)
  • ps -ax more (all system jobs)
  • ps -aux more
  • kill job
  • kill -9 job (sure kill)
  • top (tool to watch the top N jobs running)

21
PS Command
  • ps ax
  • PID S (status) Time Command
  • 1 S 440
    init
  • 2 S 120
    pageout
  • 252 R 030 named
  • 292 S 120 cron
  • 300 S 110 lpd
  • 1253 R 020 ./hw1

22
PS Command
  • ps ax
  • PID S (status) Time Command
  • 1 S 440 init
  • 2 S 120 pageout
  • 252 R 030 named
  • 292 S 120 cron
  • 300 S 110 lpd
  • 1253 R 020 ./hw1

23
PS Command
  • ps aux
  • User PID CPU MEM Start Time Command
  • smith 569 5 3 800am 345
    a.out
  • root 204 1 1 630am 030
    backup
  • mrpig 1000 50 60 200am 833 test

24
Booting/Shutdown
  • boot disk
  • LILO (linux linker loader), useful for
    multibooting/dual booting
  • Grub (another boot loader)
  • Above not needed with Solaris on a Sun
    workstation...a pc/linux thing.

25
Meg
  • login - name/passwd at the username prompt
  • logout - logout or control-d or by selecting
    logoff from the lower-left button (and can also
    shutdown system from here)

26
Shutdown
  • shutdown now go to single user mode
  • shutdown -h now halt (firmware level)
  • shutdown -r now reboot
  • reboot
  • halt
  • (see man shutdown)

27
Run Levels
  • run level
  • 0 - halt (firmware)
  • 1 - single user mode
  • 3 - multi user mode
  • 5 - multi user with xdm
  • 6 reboot
  • Can be viewed in /etc/inittab
  • id3initdefault (default bootup mode)
  • init 0 similar to halt or shutdown -h
  • init 6 similar to reboot or shutdown r
  • (see man inittab)

28
StartUp Scripts
  • /etc/rc.d/rc0.d
  • rc1.d
  • rc2.d
  • ...
  • rc6.d
  • --gt K10xxx
  • or S10xxx
  • Each specific job/daemon that must startup at
    boot time and stay running all the time, has a K
    and S file in one of the above startup areas.
    Like cron /etc/rc.d/rc3.d/S40cron
  • K40crond
  • K scripts Kill scripts S scripts Start
    scripts

29
X windows
  • Gui interface created by MIT in the mid 80s (pre
    windows days)
  • Linux - runs version called Xfree

30
Pearls of Wisdom
  • Security Issues 1. Permissions
  • BIG 3 2. Ownership
  • 3. Group
  • Good SysAdmin 1. Testing
  • BIG 3 2. Documentation
  • 3. Communication

31
Unix
  • job/processes/daemons startup and run
  • /etc/rc scripts (S and K scripts, run at bootup)
  • /etc/inetd.conf (started by inetd daemon) (also
    called xinetd daemon and /etc/xinetd.conf)
  • cron (job scheduler)

32
THE END
Write a Comment
User Comments (0)
About PowerShow.com