ក្រុមការងារយើងខ្ញុំនិងខិតខំសិក្សារស្រាវជ្រាវចំនេះដឹងបន្ថែមទៀតសំរាប់លោកអ្នក សូមអរគុណសំរាប់ការគាំទ្រ !
Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts
Linux Mail Server Configuration

Linux Mail Server Configuration

Configure Postfix : Mail server in centos

#yum -y install postfix
#yum listed installed |grep postfix
#cd /etc/postfix/
#ll
#cp main.cf main.cf.bk
#vi /etc/postfix/main.cf
search /myhostname enter
myhostname = test.local
mydomain = test.local  (# is delate for enable)     ESC /myorigin shearch
myorigin = $mydomain  (# is delate for enable) ជាកន្លែង diskplay domain name
search /mydestination ថែម $mydomain
search /mynetwork
mynetworks = 192.168.1.0/24, (# is delate for enable) 
search /inet_interfaces
 inet_interfaces = all (# is delate for enable)
search/home_mailbox
home_mailbox = maildir/  (# is delate for enable)
#service postfix restart
#service postfix status
#chkconfig postfix on
#userdd john
#passwd 123
#telnet localhost smtp        is not work
#yum -y install telnet
#telnet localhost smtp
hello localhost - >enter
mail from: john
rcpt to : john
subject : test
.    ( . is save )
quit      ( enter for exit )
#cd /home/john
#ll
#cd Maildir/
#ll
#cd new
#ll
#cat 1 hz tab
open cmd
telnet test.local smtp
#firewall-cmd --add-service=smtp --permanent --zone=public
#firewall-cmd --reload
open cmd again : telnet test.local ESMTP Postfix
hello test.local
mail from: john
rcpt to: vuthy
subject: test2
.
quit
#cd /home/vuthy
#ll
#cd Maildir/
#ll
#cd new
#ll
#cat 14 -> tab

========================================================================

Configure Dovecot : Revice mail

1/ install Dovecot Package
#yum install devecot -y
2/ Configure Dovecot
#vi /etc/dovecot/dovecot.conf
  protocols = pop3 imap
mail_location = maildir:~/maildir


3/ Disable SSL & Plaintext Authentication
#vi /etc/dovecot/conf.d/10-auth.conf
Disable_plaintext_auth = no
#vi /etc/dovecot/conf.d/10-ssl.conf
ssl=no
4/ Restart/verify Service
#service dovecot restart
#service dovecot status
#chkconfig dovecot on
5/ Allow SMTP/POP3 in firewall
#firewall-cmd --add-service=pop3 --permanent --zone=pubic
#firewall-cmd --reload
6/ Test check Mail
#telnet localhost 110
user dara
pass 123
retr 1
quit
7 Test setup on outlook
#telnet test.local
or telnet 192.168.1.2
-POP3 Server: mail.test.local
-SMTP Server: mail.test.local

View Video : link 
Linux FTP Server Configuration

Linux FTP Server Configuration

FTP  server : ( file transfer protocol )
Samba /NFS : share files in local server
FTP = share file on remote network : internet , branch

Configure FTP :

#yum -y install vsftpd
#vi /etc/vsftpd/vsfpd.conf
write_enable=yes     : check and update file   :  find word : /annon_upload_enable
anon_upload-enable  : remove # is enable script
anon_mkdir_write_enable : yes : remove # is enable script
#service vsftpd restart
#service vsftpd status
#chkconfig vsftpd on
#setenforce 0
#firewall-cmd --add-service=ftp --permanent --zone=pubic
#firewall-cmd --reload
# open browser IE: ftp://test.local     : view open FTP site in file Explorer can't create folder
# chmod -R 777 pub
#ll
close browser open again : create folder but can create sub folder
download : FTP client : name : filezila ftp client can upload file and folder
open software : -> select Entry : ceate new zone name : test.local - > General -> host : test.local port 21 -> connect
see folder
#cd ftp
#mkdir newfolder
#chmod -R 777 newfolder/
open software and than refresh you can see new folder create by centos
open newfolder you can create file and subfolder in folder new .

#mkdir -p /ftp/dara
#useradd -d /ftpdara dara
#passd dara    123
#service vsftpd restart
#server vsftpd status
open software : reconnect : word Server -> disconnect -> connect again -> user dara -> password : 123
logon type Normal

View Video : link 
Using Su & Sudo

Using Su & Sudo

Su and sudo :
1/ Su use for switch user in linux:
#su username
2/ Sudo use for allow permmision for user .
#Login as Root
#visdo
#dara All=All (allow dara run all commands from all host)
#dara All=NOPASSWD: /sbin/reboot (allow dara run only reboot )
#%finance All=NOPASSWD: /sbin/reboot (allow finance group run only reboot )

Test Locgin as user dara
========================================================================
#passwd root
New password: Right-click = QEWGWGIWUYCEYCCEUF+_-
--------------------------------------------------
su
su root
su -
--------------------------------------------------
su vuthy
--------------------------------------------------
Sudo
- give user permission to run any commands without root pwd
#sudo reboot
=> type user password
=> dara
--------------------------------------------------
dara All =NOPASSWORD: /sbin/reboot
dara localhost =All
All host=All commands

Linux System Backup & Recovery

Backup & Recovery

1. What You backup
- User data =/home
- Configuration =/etc
2. Archive using Tar (Backup)
#tar -cvf UserBackup.tar /home
#tar -cvf ConfigBackup.tar /etc
3. Compress & Archive using Tar ( backup & Zip )
#tar -czvf ConfigBackup2.tar.gz /etc (*.tar.gz=*.tgz)
4. Extract using Tar (Recovery)
#tar -xvf ConfigBackup.tgz =Extract zip file in current directory
#tar -xvf Userbackup.tar -C /Restore =Extract zip in other directory
#tar -xvf ConfigBackup.tgz abc.txt =Extract only 1 file abc.txt
#tar -xvf ConfigBackup.tgz ABC =Extract only 1 folder


Watch Videos : Link