DOC

Thinking In LINUX

By Jamie Morris,2014-08-11 00:54
6 views 0
Thinking In LINUX

    Thinking In LINUX

    Differences & Similarities

    1. Users & Groups

    a. Multi-user Operating System

    b. Security is controlled based on user’s identity

    c. Resources access can also be controlled by GROUP membership “ /etc/group ” 2. File System

    a. Works with a verity of file systems

    b. Individual file systems can flexibly incorporated

    3. Ports & Devices

    4. Networking

    a. Support a number of protocols ( TCP/IP, NetBIOS and IPX )

    b. Ability to share resources ( File & Printing )

    c. Provide capability to perform network services ( DHCP, DNS ) 5. Services

    a. Applications that run in the background to provide some functions to the system &

    computers that remotely call the service ( daemons ).

    6. Linux built for network more than printing

    a. Built & designed to live on the network

    b. Since text works well across a network, text has always been the base for Linux

    configuration and data

    c. Sophisticated networking, scripting and security

    d. Linux text-based nature is a large part of this capability

    e. Configuration files are human-readable text files “/etc”. Text file configuration makes it

    easy to backup, examine, and edit configuration without using any special system tools 7. Filename extensions

    a. Linux does not use file extensions to identify file types. Rather, Linux looks at header

    contents of a file to identify the type

    b. Linux uses file access rights to determine if a file is executable

    c. Any file can be given executable status ( programs & scripts ) 8. Rebooting is the last resort

    a. System design prevents applications from corrupting the Kernel

    b. You can Install, Start, Stop and reconfigure a system without having to reboot the system. 9. Commands are case sensitive

    10. Advantages

    a. Overhead from an Ideal GUI can be reclaimed for services

    b. Tasks can be scripted & automated

    c. Configuration files are text based and human editable

    d. You do not have to reboot the system for most tasks

    Console crash course

    1. Accessing Console

    a. Ctrl + Alt + F1 F6, each console is a completely different session on the system and can

    be accessed as different users at the same time.

    b. Consoles run different programs in their own user space

    2. Commands

    a. “cd” “/” is the one used ..! “\” means that the command will continue on the next line

    b. ls l ( long listing), ls t (sort by time), ls S (Sort by size), ls r (reverse), ls h( human),

    ls a (hidden)

    c. cp R ( recursive), cp l ( hardlink), cp f ( force )

    d. mv ( move )

    e. cat, more, less

    f. vi, man, info

    3. Which Shell ( you may change your shell by #!/bin/csh )

    a. The shell is a layer separated from the operating system.

    b. The shell you have affects the features that you have

    c. Bash ( Bourne shell ) “/bin/bash”

    d. Csh “C shell”

    e. Ksh “ Korn shell”

    f. Tcsh ( TC Shell ) enhanced version of the C shell

    g. Zsh Zshell is an enhanced version of the ksh

    4. Links

    a. Link is a reference to a file and can be treated as the original file

    b. A link can be executed, edited and accessed without having to do anything unusual

    c. Hard links:: ( ln <source> <target>

    i. Can only reference files in the same file system

    ii. It provides a reference to the file’s physical index (inode)

    iii. They do not break when you move the original file around because they point to

    the file’s physical location and not its location within the file system

    iv. Does not require the user to have access rights to the original file

    v. Does not show the location of the original file

    d. Symbolic link:: ln s <source> <target>

    i. Its a pointer to the file’s location

    ii. Can span over file systems & can point to files in a remote system

    iii. Shows the location of the original file

    iv. Requires the user to have access rights to the original file

    v. If the original file is deleted then the link is broken

    Introduction to Webmin ( webmin.com )

    1. Is a web-based interface for system administration for Unix

    a. To check for installed RPMs ( rpm q <rpm-name> )

    b. To upgrade ( rpm Uvh <rpm-name> ) (U=upgrade, V=Verbose, h=hash) 2. to run webmin http://localhost:10000

    3. webmin users are separate from operating system users

    Passwords, groups & shadow passwords

    1. Control access to resources is based on user identity

    2. root can control every process, access, every file and perform functions on the system 3. User management:

    a. Add user :: useradd <userid> -p <passwd>

    -c “comment” d /home/<userid> -g users s\ /bin/bash

    useradd -c “new test user” d /home/<userid> -g users s\ /bin/bash <userid> -p

    <userpasswd>

    b. Delete user :: userdel r <userid> ( -r will delete <userid> home directory

    c. Passwd chng :: passwd <userid> ( only root can change passwd for another user ) 4. Password /etc/passwd & /etc/shadow

    a. Username:userpasswd:userid:group_id:comment:homedir:default shell 5. Groups /etc/group & /etc/gshadow

    a. Add group :: groupadd <group>

    b. Add group member :: gpasswd a <userid> <groupname>

    c. Delete group member :: gpasswd d <userid> <groupname> 6. user & group associations

    a. each file can have only one owner & one group

    b. group definitions tend to be based more on the resource access required rather than

    business unit.

    Working with logs /var/log

    1. One of the Keys to success in managing any system is to know what is happening on the system 2. /var/log/messages log is the core system log. It contains boot, status messages as the system runs. 3. /var/log/XFree86.0.log

    4. Rotated archives “logrotate” adds “.n+1” to the log, the larger the number the older the file 5. to configure logrotate /etc/logrotate.conf

    6. log tools

    a. dmesg | more or | less to quickly view the boot log for the last system boot

    b. tail f /var/log/messages ( -f to follow ) it show new output as it comes

    c. tail -10 /var/log/messages

    d. more

    e. less

    7. to customize logging /etc/syslog.conf

    Working with partitions & file systems /etc/fstab

    1. There are no drive letters in Linux.

    a. In Linux there is just file Structure and hierarchical directory.

    b. It starts with root and all local file systems. All devices and all remote file systems are

    represented as subdirectories in this structure.

    c. Linux builds the file structure based on information in the /etc/fstab file

    d. Linux assigns them directories in the root file structure

    e. The structure of the hierarchy is flexible and highly configurable

    2. Mounting :: is the term for adding a device to the file system

    a. Linux will automatically (/) root file system as well as some special file systems

    b. To mount you have to know the correct way to reference it from Linux and

    c. Empty directory to use as a mount point.

    d. Mount /mnt/cdrom or umount /mnt/cdrom

    3. /etc/fstab is the association between a device & its mounting point

    4. /etc/fstab structure

    a. devname mount point file system type option for system flags about system”

Report this document

For any questions or suggestions please email
cust-service@docsford.com