Linux Unix help !!

"Give respect to Time, One day at right Time, Time will respect You"

Saturday, May 14, 2011

IMP Linux Services

xxxxxxxxxxxxx Important Linux Services in Linux and there meanings xxxxxxxxxxxxx

# chkconfig sshd --list                      [To check daemon default on boot running status ]
# service daemon-name status      [Check daemon present status ]
# service --status-all                         [Check all running service ]
# ntsysv                                              [Change services status ]

gpmneeded if you want to use the mouse at the console
kudzuimportant for detecting new hardware
syslogimportant for syslog services
netfsneeded only if there are NFS shares that should be mounted at boot time
networkimportant for starting network interfaces (e.g. eth eth1bonding...)
randomused for the system entropy pool
atdneeded if the at(1) service is used instead of cron
apmdAdvanced Power Management (APM) daemon is used for laptops and some desktops
isdnneeded if ISDN is being used
iptablesneeded if Netfilter (iptables) Firewall is being used
ip6tablesneeded if ip6tables Firewall is being used
pcmcianot needed on servers - needed for laptops
irqbalanceimportant for distributing interrupts across all CPUs
sendmaineeded if Sendmail is used - Procmail should be used which is more secure
autofsneeded if automounter is used - production applications should not be dependent on automounter
sshdimportant for logins via SSH
portmapneeded if e.g. NFS is being used
nfslockneeded if NFS shares are mounted
nfsneeded if server runs the NFS server
mdmonitorneeded only if software RAID is being used
crondimportant for running cron jobs
xinetdneeded if xinetd services are being used see /etc/xinetd.d/ for list of services
cupsneeded if CUPS is used for the printing system
rhnsdneeded if server should connect to RHN to check for software updates etc.
sysstatneeded to reset system statistics logs
auditneeded only if Linux Audit Subsystem (LAuS) should run for collecting system call audit records
psacctneeded only if kernel process accounting information is needed
smartdimportant for monitoring disk problems if hard disks support SMART technology
netdumpimportant if kernel oops data and memory dumps should be sent to a Netdump server for server crashes
 
Rest will add sooooonnnn .....

Diff ext2 ext3 ext4

xxxxxxxxxxxxxxxxxxxxx Diff ext2 ext3 ext4 xxxxxxxxxxxxxxxxxxxxxxxxx
Extended n file system

ext2 :
- Introduced with kernel 1.0 in 1993
- Flexible can handle upto 4TB
- super block feature increase file system performance
- ext2 reserve 5% of disk space for root
- ext2 is popular on USB and other solid-state devices.
  This is because it does not have a journaling function.
  so it generally makes fewer reads and writes to the drive,
  effectively extending the life of the device .
-  NO journalalizm

ext3 :
- Provide all the feature of ext 2 + journaling and backward compatibility .
- can upgrade ext2 to ext3 without loss of data.
- journaling feature speed up the system to recover the state after power-failure
  or improper mount unmount etc.
- Example: In ext2 in an improper unmount or in-between power-off etc.. so in time
  of receiver it checks whole file system .
  But in ext3 it keeps record of uncommitted file transactions and checks applied
  on on them so system will come back up in faster and quicker .
-

ext4:
- Introduced with kernel 2.6.28
- Ext4 is a deeper improvement over Ext3
- support  larger filesystem, faster checking, nanosecond timestamps,
  and verification of the journal through checksums.
- It’s backward and forward compatible with versions 2 and 3, so we can
  mount a ext2 or ext3 filesystem as ext4 .
- The main benefits that ext4 has over ext3 are:
  - faster time-stamping
  - faster file system checking
  - journaling check-sums
  - extents (basically automatic space allocation to avoid fragmentation)

What is Journalism in linxu file syatem ?
A journaling file system is a file system that keeps track of the changes that will be made in
a journal (usually a circular log in a dedicated area of the file system) before committing them to
the main file system. In the event of a system crash or power failure, such file systems are quicker
to bring back online and less likely to become corrupted.
difference between ext2 ext3 ext4, extended file system linux, ext2, ext3,ext4, what is ext in linux, partition types in linux, file partition in linux, linxu partitions , ext2 ext3, ext4 linux, linuxva, shirish, shukla

File Permission Linux

xxxxxxxxxxxxxxxxxxxxxx File Permission xxxxxxxxxxxxxxxxxx

Set user ID, set group ID, sticky bit

- SUID or setuid:[4] Change user ID on execution. If setuid bit is set, when the file being executed by any user,  the process will have the same rights as the owner of the file being executed.

- SGID or setgid:[2] Change group ID on execution. Same as above, but inherits rights of the group of the owner of the file on execution. For directories it also may mean that when a new file is created in the directory it will inherit the group of the directory (and not of the user who created the file).

- Sticky bit:[1] It was used to trigger process to "stick" in memory after it is finished, now this usage is obsolete. Currently its use is system dependent and it is mostly used to suppress deletion of the files that belong to other users in the folder where you have "write" access to.
               -->> If the sticky bit is set for a directory, only the owner of that directory or the owner of a file can delete or rename a file within that directory.
          
               EG:  Login as root
                                     # mkdir /usr/Shirish
                                     # touch /usr/Shirish/shukla
                                     # chmod -R 1777 /usr/Shirish/shukla
                      Login as normal user : sks
                                     # ls -l  /usr/Shirish/shukla            
                                        -rwxrwxrwt 1 root root 16 Feb 11 00:31  /usr/Shirish/shukla
                                     # rm -fr /usr/Shirish/shukla
                                        rm: cannot remove `/usr/Shirish/shukla': Operation not permitted
                                  

SUID bit is set for files ( mainly for binary files only, note It'll not work on perl or shell scripts).
The SUID permission makes a binary to run as the user who is the owner of the binary, rather than the user who started it.

SGID, it will run with the privileges of the files group owner, instead of the privileges of the person running the program.

-----------------------------------------------------------------------------------
0755 -> setuid, setgid, sticky bits are cleared        000
1755 -> sticky bit is set                                              001
2755 -> setgid bit is set                                             010
3755 -> setgid and sticky bits are set                      011
4755 -> setuid bit is set                                             100
5755 -> setuid and sticky bits are set                      101    
6755 -> setuid and setgid bits are set                     110
7755 -> setuid, setgid, sticky bits are set                111
-----------------------------------------------------------------------------------


Shirish Shukla
Any comments are welcome .
File Permission Linux, file permission, linux file permission, file permiss, permission linux, security file, file security, user file permission, permissions, linux, linuxva, shirish, shukla

Tuesday, May 3, 2011

Types of Processes in linux

xxxxxxxxxxxxxxxxxx Types of Process in Linux xxxxxxxxxxxxxxxxxxxxxxxx

Every application it may be system specific or application daemon specific. It have to started as process
in background or foreground as designed.

Below are the few common process states:

Runnable: Process started and it's running and is in active queue in meantime it may in waiting for CPU resource.

Stopped: Process started and stopped in between but is not fully killed and can run if started again.

Sleeping/Waiting:  Process started and at meantime there are to many request to CPU from some other process or it's is waiting for another process to complete.

Zombie: Process started and started another child process and then parent process gone/died, in such condition that child process doesn't know how to end, so it's hang around but living, such process is known as zombie process.

More About Foreground/Background Process < fg and bg command linux >

Types of process in linux, zombie process linux , zombie process, processes background, foreground, stopped process, foreground process

Followers

Pls LIKE my Story !!!