Linux OS - Notes
Linux OS - Notes
Step 1... Determine the CHAIN (INPUT/ OUTPUT/ FORWARD) ---> -A INPUT
Step 2... Bind to specific ethernet port ( -i eth0 ) ---> -i eth0
Step 3... Defining the source (Port + Protocol + IP) ---> -s
20.102.80.220/255.255.255.255
Step 4... Defining the destination (Port + Protocol + IP) ---> -p 80,443
+ -d 8.8.8.8
Step 4.1... Defining the stateful inspection + fine tuning the
communication rate ---> -m state --state NEW, ESTABLISHED
Step 5... Take action (DROP/ ACCEPT/ RETURN|REJECT) ---> -j DROP
-I INPUT 1
--check INPUT
Linux OS – Notes
Stateful Inspection:
New connection is initiated from host to server ---> NEW
Active connection is running between host and server ---> ESTABLISHED
Terminating connection between host and server ---> CLOSED
CLOSED STATE
Host ---> FIN ---> Server
Server ---> Ack ---> Host
subtree_check
/tmp/A/B
/tmp - exported or not?
Linux OS – Notes
root_squash --> Map the UID / GID of "0" to UID / GID of Anonymous user
no_root_squash --> Map the UID / GID of "0" to UID / GID of Root only
all_squash --> Map the UID / GID of all users to UID / GID of Anonymous
user
no_all_squash --> Map the UID ? GID of all users to respective UID and
GID on local machine (NFS Server)
NFS:
Server Side:
Step 1 - edit the /etc/exports file and add rule. Example: /tmp
*(rw)
Step 2 - exportfs -a (to export all the shared folders)
Step 3 - exportfs -v (to verify the exported list)
Step 4 - Start / Re-start the nfs-server service
Client Side:
Step 1 - Verify the export list by running the command --> showmount -e
<IP OF NFS SERVER>
Step 2 - Mount the remote share using the command format --> mount -t nfs
<IP>:<NFS Shared Folder> <Local Mount POint>. Example --- mount -t nfs
10.0.0.6:/tmp /mnt/mount_folder
2. share (Define the permissions on the file system to who can access the
share)
3. server (LDAP / Active Directory integration)
passdb backend:
1. tdbsam (Local system db)
2. ldapsam (LDAP / AD db)
"password server = <ip/ name>"
[RACE]
path = /tmp
writeable = yes
guest ok = no
read only = no
valid users = j0ker
inherit acls = yes
log file = /var/log/smb_share_1.log
Next Step is to provide the password for the valid user. Because system
password and samba password are / can be different.
sample smb.conf
[global]
workgroup = RACE
security = user
# printing = cups
Linux OS – Notes
[share1]
comment = Testing of Samba services
valid users = RACE1, RACE2
browseable = Yes
read only = No
inherit acls = Yes
path = /tmp
log file = /var/log/SAMBA_%m.log
[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes
[printers]
comment = All Printers
path = /var/tmp
printable = Yes
create mask = 0600
browseable = No
[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = @printadmin root
force group = @printadmin
create mask = 0664
directory mask = 0775
[RACE]
path = /tmp
writeable = yes
guest ok = no
read only = no
valid users = joker
inherit acls = yes
log file = /var/log/smb_share_1.log
Syslog (earlier)
Rsyslog (current)