major directories | filesystems

Administration of Filesystem and Security
-Mount/Manage Filesystems, Partitions, Devices
-Security : Best Practices, RisksFilesystems, Partitions,

Devices commands:
mkfs (create partition), fdisk, fsck (examine partitions, check partition for errors)
mount, umount (partitions and devices)
df (file system usage), du (info on disk usage)
/mnt, /dev (important direcotries)

What's a filesytem?
1)Directory structure /etc/home
2)Low-level organization
Ext2fs
Ext3
ReiserFS

fdisk -l --->lists all disks
sda (scsi disk, A- first disk)
sdb - second disk
boot * - holds linux kernel image
Swap partition gets used when main memory fills up (RAM)
Swap like extension main memory
We don't need swap partition and can use swap files, but swap files work much slower
fdisk /dev/sda
When you add new disk, you should add a new partition with command fdisk /dev/sda
fsck /dev/sda2 - Here you can see filesystem (EXT2 FS,etc)

Administration of Filesystem and Security

Agenda to create put new HD into the system
1)Create partition on the disk
2)Format using fsck/mkfs commands
3)Mount disk suing mount command

Mounting Example: mount -t iso9660 /dev/cdrom/ /mnt/cdrom
umount /dev/cdrom
du, df - to display size, what is used and from where it comes
df - command displays information about filesystem (Available space, Use%,where devices mounted)
df -h - display In human readable way
du -h - display all directories and subdirectories
du --max-depth=1 -h - display only directories

Description of main directories
bin - here stored all execute commands (ls,cp)
boot - linux boot kernel image files and config boot files
dev - holds 1 file for every device in the system
etc - system configuration files
home - users home directory
lib - shared program files, common code that used by shared programs
mnt - removable media,cd, floppy
opt - optional software,prepackeged games,spreadsheet
proc - processess info
root - root user homedirectory
sbin - system administration utilities
tmp - temp directory, any user can use tmp
var - variable data, logs, users mail ditrectory, info that changes everytime
usr - user specific resources,directories (presents here bin,sbin,etc)
usr/bin - holds only special commands (not like ls,cp)
usr/include - particular C functions
usr/local - ???

Security
- Accounts/Passwords
- Filestems/Programs
- SUID permissions

Accounts/Passwords
-Remove dormant accounts (dormant - no longer used or no ever used)
-Get users to pick good passwords

Filesystem/Programs
-Remove unnecessary programs
- user's permissions umask values in /etc/profile

cat etc/shadow - encrypted passwords
ls -l /usr/bin/passwd
ls -l /etc/shadow - directory is readable by root. No other permissions
Passwd command (used for change passwords) is located in
ls - l /usr/bin/passwd
-r-s--x--x /usr/bin/passwd -- s (SUID), you can save data (change password) as root

Comments

Popular posts from this blog

HAproxy logging

tomcat catalina coyote jasper cluster

NFS mount add in fstab _netdev instead of default | firewall-cmd --list-all