Training Linux Server - PowerPoint PPT Presentation

1 / 42
About This Presentation
Title:

Training Linux Server

Description:

Cwlocalhost jodoi.com ( ????? domain ????????????????? Mail Server ) ... 00:00:05, xdelay=00:00:05, mailer=esmtp, pri=30419, relay=a.mx.mail.yahoo.com. ... – PowerPoint PPT presentation

Number of Views:554
Avg rating:3.0/5.0
Slides: 43
Provided by: jod6
Category:

less

Transcript and Presenter's Notes

Title: Training Linux Server


1
Training Linux Server
Mr.Kriangsak Namkot jodoi_at_jodoi.com jodoi1819_at_hotm
ail.com http//www.jodoi.com http//www.doi.in.th
http//www.jodoi.in.th
2
FTP Server
  • root_at_jodoi / rpm -q vsftpd
  • vsftpd-2.0.1-5.EL4.5
  • root_at_jodoi / service vsftpd start
  • Starting vsftpd for vsftpd OK
  • root_at_jodoi / /etc/init.d/vsftpd restart
  • Shutting down vsftpd OK
  • Starting vsftpd for vsftpd OK
  • root_at_jodoi / locate vsftpd.conf
  • /etc/vsftpd/vsftpd.conf

3
FTP Server
  • root_at_jodoi / netstat -tanp grep 21
  • tcp 0 0 0.0.0.021 0.0.0.0
    LISTEN 4037/vsftpd
  • root_at_jodoi / ps -ef grep ftp
  • root 4037 1 0 0426 pts/0 000000
    /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf
  • root 4043 3975 0 0426 pts/0 000000
    grep ftp
  • root_at_jodoi / ntsysv ( set ??? vsftpd start
    ?????????????????????? )
  • ????
  • root_at_jodoi / setup

4
FTP Server
  • root_at_jodoi / ftp 192.168.200.249
  • Connected to 192.168.200.249.
  • 220 (vsFTPd 2.0.1)
  • 530 Please login with USER and PASS.
  • 530 Please login with USER and PASS.
  • KERBEROS_V4 rejected as an authentication type
  • Name (192.168.200.249root) jodoi (???
    username ?????????????????? Server)
  • 331 Please specify the password.
  • Password ( ??? password )
  • 230 Login successful.
  • Remote system type is UNIX.
  • Using binary mode to transfer files.
  • ftp
  • ftp quit
  • 221 Goodbye.
  • root_at_jodoi /

5
FTP Server
6
FTP Server
  • Configure FTP for root logins
  • Edit the files
  • /etc/vsftpd.ftpusers and /etc/vsftpd.user_list
  • and remove the 'root' line from each file.

7
Mail Server
  • root_at_doiserver root rpm -q sendmail
  • sendmail-8.12.8-4
  • root_at_jodoi / locate sendmail.cf
  • /etc/mail/sendmail.cf
  • root_at_jodoi mail cp /etc/mail/sendmail.cf
    /etc/mail/sendmail.cf.backup
  • root_at_jodoi mail vi /etc/mail/sendmail.cf
  • Cwlocalhost jodoi.com ( ????? domain
    ????????????????? Mail Server )
  • O DaemonPortOptionsPortsmtp,Addr0.0.0.0,
    NameMTA ( ???? IP ?????? Mail ?????????? IP
    ??????? )
  • O MaxMessageSize10000000 (set ?????????????
    e-mail ???? 10 M )

8
Mail Server
  • root_at_jodoi mail vi /etc/mail/access
  • localhost.localdomain RELAY
  • localhost RELAY
  • 127.0.0.1 RELAY
  • 192.168 RELAY (
    ?????????????? 192.168 ????????? )
  • root_at_jodoi mail makemap hash /etc/mail/access
  • ( ????????????????? ???????????? access ???? )

9
Mail Server
  • Ex
  • service pop3
  • disable no
  • flaqs REUSE
  • socket_type stream
  • wait no
  • user root
  • server /usr/sbin/ipop3d
  • log_on_success HOST DURATION
  • log_on_failure HOST

10
Mail Server
  • root_at_jodoi / service xinetd restart
  • Stopping xinetd OK
  • Starting xinetd OK
  • root_at_jodoi / service sendmail restart
  • Shutting down sendmail OK
  • Shutting down sm-client OK
  • Starting sendmail OK
  • Starting sm-client OK
  • root_at_jodoi / netstat -tanp grep 110
  • tcp 0 0 0.0.0.0110 0.0.0.0
    LISTEN 407/xinetd
  • root_at_jodoi / netstat -tanp grep 25
  • tcp 0 0 0.0.0.025 0.0.0.0 LISTEN
    436/sendmail accep

11
Mail Server
  • setup ???? ntsysv ???????? service sendmail
    ??? xinetd auto start ??????????????

12
Mail Server
  • root_at_doiserver root telnet 192.168.200.249 25
  • Trying 192.168.200.249...
  • Connected to 192.168.200.249.
  • Escape character is ''.
  • 220 localhost.localdomain ESMTP Sendmail
    8.12.8/8.12.8 Wed, 27 Jun 2007 094813 0700
  • helo doi-server.com
  • 250 localhost.localdomain Hello
    192.168.200.249, pleased to meet you
  • mail fromjodoi1819_at_hotmail.com
  • 250 2.1.0 jodoi1819_at_hotmail.com... Sender ok
  • rcpt tojodoi_at_doi-server.com
  • 250 2.1.5 jodoi_at_doi-server.com... Recipient ok

13
Mail Server
  • data
  • 354 Enter mail, end with "." on a line by itself
  • This is test mail from Mr.Jodoi.
  • .
  • 250 2.0.0 l5R2mDPV001868 Message accepted for
  • delivery
  • quit
  • 221 2.0.0 localhost.localdomain closing
    connection
  • Connection closed by foreign host.
  • root_at_doiserver root

14
Mail Server
15
Mail Server
16
Mail Server
  • root_at_doiserver root tail -f /var/log/maillog
  • Jun 27 101547 doiserver ipop3d1916 Login
    userjodoi host192.168.200.246 nmsgs4/4
  • Jun 27 101547 doiserver ipop3d1916 Logout
    userjodoi host192.168.200.246 nmsgs4 ndele0
  • Jun 27 101621 doiserver sendmail1917
    l5R3GLPV001917 from,
    size1177, class0, nrcpts1, msgida94e8240f964a8c0_at_jodoi, protoSMTP, daemonMTA,
    relay192.168.200.246
  • Jun 27 101621 doiserver sendmail1918
    l5R3GLPV001917 to,
    delay000000, xdelay000000, mailerlocal,
    pri31354, dsn2.0.0, statSent
  • Jun 27 102108 doiserver sendmail1926
    l5R3L2PV001924 to,
    ctladdr (500/500),
    delay000005, xdelay000005, maileresmtp,
    pri30419, relaya.mx.mail.yahoo.com.
    209.191.118.103, dsn2.0.0, statSent (ok
    dirdel)
  • Jun 27 102314 doiserver sendmail1932
    l5R3N9PV001930 to,
    ctladdr (500/500),
    delay000005, xdelay000005, maileresmtp,
    pri30425, relaymx4.hotmail.com.
    65.54.245.104, dsn5.0.0, statService
    unavailable

17
Webmail
  • root_at_doiserver root rpm -q squirrelmail
  • squirrelmail-1.2.10-4
  • root_at_doiserver root vi /etc/xinetd.conf
  • service imap
  • disable no
  • socket_type stream
  • wait no
  • user root
  • server /usr/sbin/imapd
  • log_on_success HOST DURATION
  • log_on_failure HOST

18
Webmail
  • root_at_doiserver root netstat -tanp grep 143
  • tcp 0 0 0.0.0.0143 0.0.0.0 LISTEN
    1617/xinetd
  • root_at_doiserver root cp -r /usr/share/squirrelma
    il/ /var/www/html/
  • root_at_doiserver / cd /var/www/html/squirrelmail/
    config
  • root_at_doiserver config rm config.php
  • root_at_doiserver config ./conf.pl
  • Menu ???????????????????? ??? 1. Organization
    Preferences ,
  • 2. Server Settings ??? 4. General Options

19
Webmail
  • SquirrelMail Configuration Read config.php
    (1.2.0)
  • --------------------------------------------------
    -------
  • Main Menu --
  • 1. Organization Preferences
  • 2. Server Settings
  • 3. Folder Defaults
  • 4. General Options
  • 5. Themes
  • 6. Address Books (LDAP)
  • 7. Message of the Day (MOTD)
  • 8. Plugins
  • 9. Database
  • D. Set pre-defined settings for specific IMAP
    servers
  • C. Turn color on
  • S Save data
  • Q Quit

20
Webmail
  • Menu 1 Organization Preferences ????? ??? 1.
    Organization Name
  • SquirrelMail Configuration Read config.php
    (1.2.0)
  • --------------------------------------------------
    -------
  • Organization Preferences
  • 1. Organization Name JodoiMail
  • 2. Organization Logo ../images/sm_logo.pn
    g
  • 3. Org. Logo Width/Height (308/111)
  • 4. Organization Title SquirrelMail
    version
  • 5. Signout Page
  • 6. Default Language en_US
  • 7. Top Frame _top
  • R Return to Main Menu
  • C. Turn color on
  • S Save data
  • Q Quit
  • Command

21
Webmail
  • Menu 2 Server Settings ????? ??? 1. Domain
    ????????? Mail domain ?? sendmail
  • ???????? ??? 4. Use Sendmail/SMTP ???????
    Sendmail
  • SquirrelMail Configuration Read config.php
    (1.2.0)
  • --------------------------------------------------
    -------
  • Server Settings
  • 1. Domain doi-server.com
  • 2. IMAP Server localhost
  • 3. IMAP Port 143
  • 4. Use Sendmail/SMTP Sendmail
  • 5. Sendmail Path /usr/sbin/sendmail
  • 10. Server cyrus
  • 11. Invert Time false
  • 12. Delimiter detect
  • R Return to Main Menu
  • C. Turn color on
  • S Save data
  • Q Quit

22
Webmail
  • Menu 4 General Options ???????? 2. Data
    Directory ???? /var/lib/squirrelmail/prefs/
  • ??????????? 3. Attachment Directory ????
    /var/spool/squirrelmail/attach/
  • SquirrelMail Configuration Read config.php
    (1.2.0)
  • --------------------------------------------------
    -------
  • General Options
  • 1. Default Charset iso-8859-1
  • 2. Data Directory
    /var/lib/squirrelmail/prefs/
  • 3. Attachment Directory
    /var/spool/squirrelmail/attach/
  • 4. Directory Hash Level 0
  • 5. Default Left Size 150
  • 6. Usernames in Lowercase false
  • 7. Allow use of priority true
  • 8. Hide SM attributions false
  • 9. Allow use of receipts true
  • 10. Allow editing of identity true
  • R Return to Main Menu
  • C. Turn color on

23
Webmail
  • ????????????????????? S ???????????????????
    Config ????? Q ????????? Config ??????????????
    Webmail ??????? Browser ???? http//192.168.200.2
    49/squirrelmail/

24
Webmail
  • ???????? user ???password ???????????
    ???????????????????????

25
Webmail
  • ???????????????????????? http//192.168.200.249/we
    bmail ???????????
  • root_at_doiserver config cd /var/www/html/
  • root_at_doiserver html mv squirrelmail webmail

26
DNS Server
  • root_at_doiserver html vi /etc/resolv.conf
  • root_at_doiserver html nslookup
  • set typens
  • pantip.com
  • Server 203.149.0.3
  • Address 203.149.0.353
  • Non-authoritative answer
  • pantip.com nameserver ns4.hostpacific.net.
  • pantip.com nameserver ns1.hostpacific.net.
  • Authoritative answers can be found from
  • ns1.hostpacific.net internet address
    203.146.102.110
  • ns4.hostpacific.net internet address
    66.98.246.87

27
DNS Server
  • DNS Resource Type
  • A IPv4
  • CNAME nickname (canonical name)
  • AAAA IPv6
  • NS Name Server
  • MX Mail Exchange
  • PTR Reverse DNS (IP -- Name)

28
DNS Server
  • dig
  • dig trace www.google.com
  • dig trace www.jodoi.com
  • dig www.pantip.com
  • dig _at_203.146.102.110 www.pantip.com
  • dig _at_203.149.0.3 www.pantip.com

29
DNS Server
  • 1. Cache only DNS
  • root_at_doiserver html vi /etc/named.conf
  • root_at_doiserver html service named start
  • root_at_doiserver html netstat -anp grep 53
  • tcp 0 0 192.168.200.24953
    0.0.0.0 LISTEN 8864/
  • tcp 0 0 127.0.0.153
    0.0.0.0 LISTEN 8864/
  • tcp 0 0 127.0.0.1953
    0.0.0.0 LISTEN 8864/
  • udp 0 0 192.168.200.24953
    0.0.0.0 8864/
  • udp 0 0 127.0.0.153
    0.0.0.0 8864/

30
DNS Server
  • 2.Forwarder DNS
  • root_at_doiserver html vi /etc/named.conf
  • options
  • forwarders
  • 203.149.0.3
  • 203.149.0.2
  • root_at_doiserver root vi /etc/resolv.conf
  • nameserver 127.0.0.1
  • root_at_doiserver root tcpdump -i eth0 port 53

31
DNS Server
  • 3. Authoritative Primary (Master) Name Server
  • adding a zone to named.conf
  • vi /etc/named.conf
  • zone "localhost" IN
  • type master
  • file "localhost.zone"
  • allow-update none
  • zone "doi-server.com"
  • type master
  • file "/var/named/db.doi-server.com"

32
DNS Server
  • root_at_doiserver named cp named.local
    db.doi-server.com
  • root_at_doiserver named chown namednamed
    db.doi-server.com
  • root_at_doiserver named vi db.doi-server.com
  • TTL 86400
  • _at_ IN SOA doi-server.com.
    jodoi.yahoo.com. (
  • 1997022700
    Serial
  • 28800
    Refresh
  • 14400
    Retry
  • 3600000
    Expire
  • 86400 )
    Minimum
  • _at_ IN NS 192.168.200.249
  • _at_ IN A 192.168.200.249
  • www IN A 192.168.200.249
  • mail IN CNAME www.doi-server.com.

33
DNS Server
  • root_at_doiserver named service named reload
  • Reloading named OK
  • root_at_doiserver named tail -f /var/log/messages
  • Jun 28 100936 doiserver named1989 loading
    configuration from '/etc/named.conf'
  • Jun 28 100936 doiserver named1989 no IPv6
    interfaces found
  • Jun 28 100936 doiserver named1989 zone
    doi-server.com/IN loaded serial 1997022700
  • Jun 28 100936 doiserver named1989 zone
    doi-server.com/IN sending notifies (serial
    1997022700)
  • Jun 28 100936 doiserver named named reload
    succeeded

34
DNS Server
  • 3. Authoritative Primary (Master) Name Server
  • Authoritative Secondary (Slave) Name Server
  • _at_SLAVE (_at_192.168.200.247)
  • vi /etc/named.conf
  • ADD NEW ZONE
  • zone doi-server.com"
  • type slave
  • file "/var/named/db.doi-server.com"
  • // content of this file is
    transfered from master
  • masters 192.168.200.248
  • allow-notify 192.168.200.248
  • chmod gw /var/named
  • service named restart

35
DNS Server
  • _at_MASTER (_at_192.168.200.248)
  • vi /etc/named.conf
  • ...
  • zone doi-server.com"
  • ....
  • ADD
  • allow-transfer 192.168.200.247
  • also-notify 192.168.200.247
  • service named restart

36
File Server
  • root_at_doiserver named rpm -q samba
  • samba-2.2.7a-7.9.0
  • root_at_doiserver named mkdir /tmp/doi-share
  • root_at_doiserver named vi /etc/samba/smb.conf
  • hosts allow 192.168.1. 192.168.200. 127.
  • security share
  • tmp
  • comment Temporary file space
  • path /tmp/doi-share
  • read only no
  • public yes

37
File Server
  • root_at_doiserver named service smb start
  • root_at_doiserver named netstat -anp grep 139
  • tcp 0 0 0.0.0.0139
    0.0.0.0 LISTEN 2642/smbd
  • root_at_doiserver named netstat -anp grep 137
  • udp 0 0 192.168.200.249137
    0.0.0.0 2646/nmbd
  • udp 0 0 0.0.0.0137
    0.0.0.0 2646/nmbd
  • ??????????????? PC ??????

38
File Server
  • ?????? Floder ??? Share ??? ??????

39
DHCP Server
  • root_at_doiserver / rpm -q dhcp
  • dhcp-3.0pl1-23
  • root_at_doiserver / wget ftp//fr.rpmfind.net/linux
    /redhat/9/en/os/i386/RedHat/RPMS/dhcp-3.0pl1-23.i3
    86.rpm
  • root_at_doiserver / rpm -ivh dhcp-3.0pl1-23.i386.r
    pm
  • root_at_doiserver / cp /usr/share/doc/dhcp-3.0pl1/
    dhcpd.conf.sample /etc/dhcpd.conf
  • root_at_doiserver / vi /etc/dhcpd.conf
  • root_at_doiserver / service dhcpd start
  • Starting dhcpd OK
  • root_at_doiserver / netstat -anp grep 67
  • udp 0 0 0.0.0.067 0.0.0.0
    2694/dhcpd

40
DHCP Server
  • root_at_doiserver / vi /etc/dhcpd.conf
  • subnet 192.168.200.240 netmask 255.255.255.240
  • --- default gateway
  • option routers
    192.168.200.254
  • option subnet-mask
    255.255.255.240
  • option nis-domain
    "domain.org"
  • option domain-name
    "domain.org"
  • option domain-name-servers
    192.168.200.254
  • range dynamic-bootp 192.168.200.245
    192.168.200.246

41
DHCP Server
42
DHCP Server
Write a Comment
User Comments (0)
About PowerShow.com