Linux basic concepts and Personal notes summary (5)

Source: Internet
Author: User
Tags readable

Security code: Before departure All is just a dream, action after all the challenges

This section focuses on Linux infrastructure and samba server construction

Nineth Linux Basic network settings

First, view network parameters

1. View IP address information

Ipconfig (view events)

Parameters:-A (view all), eth0 (view eth0 only)

2. View Host Name

Hostname

3. View the routing table (default gateway)

Route-n or Netstat-rn

4. View TCP/UDP Port Information

NETSTAT-AUPTU (a table all, n table number, p table process id,t refers to tcp,u refers to UDP)

5. Tracking Network nodes

Traceroute

6. Test DNS resolution

Nslookup

Second, set the network parameters

1. Configure IP Address

Ifconfig eth0 IP Address

Ifconfig eth0:2 IP Address

2. Configure the default gateway

Route add default GW gateway address (ADD)

Route del default GW gateway address (DELETE)

Third, set the network parameters (fixed)

1. Modify the IP address and default gateway

/etc/sysconfig/network-scripts/ifcfg-eth0

Need to restart service to take effect: Services Network restart

or disable when enabled: Ifdown eth0;ifup eth0

2, modify the computer name (restart effective)

/etc/sysconfig/network

Modify the Hostname= host name

3. Modify preferred and alternate DNS address files

/etc/resolv.conf

4. Local hostname mapping file (effective immediately)

/etc/hosts

Iv. DHCP Services

1. Check if the service pack is installed

RPM-QA |grep DHCP

If not installed, insert the system installation CD

Must be overwritten after installation:CP /usr/share/doc/dhcp-4.1/dhcpd.conf.sampe (sampe file) /etc/dhcp/dhcpd.conf (main provisioning file)

2. Service Script

/etc/init.d/dhcp.d

Start Services: Service DHCPD start

3. Port number:

udp:67 (server)

udp:68 (client)

4. Troubleshoot errors, view logs

Tail-30/var/log/messages

Prevent conflicts, as shown in the notes:

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M02/86/86/wKioL1fCkwSixygiABhJh69MoEA809.png-wh_500x0-wm_3 -wmp_4-s_1008587710.png "title=" 9120a19a72f5bd83c78b84498541c414.png "alt=" Wkiol1fckwsixygiabhjh69moea809.png-wh _50 "/>

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M02/86/86/wKioL1fClAHQ3s2qAAzL2zpBrpA224.png-wh_500x0-wm_3 -wmp_4-s_2967653683.png "title=" Dcd79accd0ad7990828d93530ae649d4.png "alt=" Wkiol1fclahq3s2qaazl2zpbrpa224.png-wh _50 "/>

Chapter Tenth Samba file sharing service

First, the installation package

Rpm-ivh samba-3.x.x .....

Second, Samba services

1. Samba Server Main program

SMBD: Provides shared access to files and print resources in the server, TCP port numbers 139 and 445

NMBD: Provides resolution based on NetBIOS host name, UDP port number 138 and 137

2. Samba configuration directory and files

/etc/init.d/smb

3. Samba configuration directory and files

/etc/samba/smb.conf

III. Global configuration items for the master configuration file smb.conf

1. Security: Safety level, the available values are as follows:

Share (anonymous access)

User (local user authentication username and password)

Server (other Linux server Authentication)

Domain (Windows domain Controller authentication)

2. Meaning of common shared directory configuration items

Path: (The actual path of the shared directory in the server)

Guest OK (or public): whether to allow everyone access to share permissions

Read only (read-only, default does not write is read-only)

Writable (readable and writable)

Iv. building an anonymous shared access (practice is the only criterion for testing theory)

1. Modify the master configuration file/etc/samba/smb.conf

Security=share

2. Create a custom share

"Software"

Path=/software

Publice=yes

Read Only=yes

Note: The/software directory needs to be created in the system

3. Start the service or restart the service

Service SMB Start/restart

V. Build a local user-authenticated shared access

1. Create users and add them to samba users

Useradd Zhangsan

Pdbedit-a-U Zhangsan

2. Modify the master configuration smb.conf file

Security=user

3. Custom Sharing

Such as: Finance department to share documents, financial manager Full Control, Finance Department staff read only, others do not have permission

"Caiwubu"

Path=/caiwubu

Valid USERS=CWJL, @cwb (define legitimate users)

Write List=cwjl (defines a legitimate readable writable user)

Vi. setting default permissions for uploading files and directories

Directory mask=0775 (catalog permissions)

Create mask=0644 (file permissions)

Seven, aliases

1. Modify the alias configuration file

/etc/samba/smbusers

2. Modify the smb.conf file

Add a row in "Golbal"

Username map =/etc/samba/smbusers

Prevent conflicts, as shown in the notes:

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/86/86/wKioL1fCoCPh-J18AA7SrDvbVWQ338.png-wh_500x0-wm_3 -wmp_4-s_358694459.png "title=" A318b23dd8040540bb0910a8159451f7.png "alt=" Wkiol1fcocph-j18aa7srdvbvwq338.png-wh_ "/>

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/86/86/wKiom1fCoMni4ttDAA3UX1IScBM925.png-wh_500x0-wm_3 -wmp_4-s_3856432319.png "title=" 2d62b03b5e46b6749b81013e37a91aeb.png "alt=" Wkiom1fcomni4ttdaa3ux1iscbm925.png-wh _50 "/>

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/86/86/wKioL1fCoP_iXwtUAAyVp-AM3ps744.png-wh_500x0-wm_3 -wmp_4-s_4178394038.png "title=" 979b135343c3fdff8f007a3a14f6dd3b.png "alt=" Wkiol1fcop_ixwtuaayvp-am3ps744.png-wh _50 "/>

Thanks for watching, come on, guys!


















This article is from "A Candle" blog, please be sure to keep this source http://yw666.blog.51cto.com/11977292/1843550

Linux basic concepts and Personal notes summary (5)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.