Day 23rd: Configuring NFS and Samba Services

Source: Internet
Author: User

Small Q: life is to endure loneliness to keep the prosperous, the age of struggle do not choose ease;

Some things, not to see the hope to persist, but to insist on only hope.


Today actually don't see much, keep on operating, gradually find out how important the log is, but I still do not want to see the log, really silly; this is an initial understanding of NFS and Samba services with me!




NFS Deployment and Optimization:

NFS = Network + file + system

is one of the file systems supported by FreeBSD that allows computers in the network to share resources across TCP/IP networks. In NFS applications, client applications for local NFS can transparently read and write to files located on the remote NFS server as if they were accessing local files;

For example, I have three servers, I want to copy some files to three, there are changes to each machine to be modified,

Too much trouble also consumes resources.


One:

Service-Side machine settings:


Installation: Yum install-y nfs-utils rpcbind NFS Network Service; Rpcbind communication function

To enter the configuration file:

Vim/etc/exports

Add

/mnt 192.168.1.106 (rw,sync)/mnt directory client IP to mount (read/write, sync files)

Start

/etc/init.d/rpcbind start

/etc/init.d/nfs start

View: SHOWMOUNT-E service-side IP View the client being serviced


Client machine settings:


Installation: Yum install-y nfs-utils

Mount: Mount-t NFS 192.168.1.103:/mnt/opt

-T NFS Mounts server-side IP via NFS service: Shared directory custom mounted directory


Question: 1. Even root, we cannot operate on the OPT directory or change the permissions;

MNT is set to 777 permissions for the client to operate.

2. We create a new directory or file, the owner of the group default to Nfsnobody, how do we change it?


Two:

Reconfigure/etc/exports

Change

/mnt 192.168.1.106 (rw,sync,all_squash,anonuid=502,anongid=502)

All_squash restrict all users; anonuid,anongid default client belongs to the main group


Restart NFS:/etc/init.d/nfs restart or Exportfs-arv


Client:

Uninstall: umount/opt

Mount: Mount-e nfs-onolock,nfsvers=3 192.168.1.103:/mnt/opt

-onolock does not lock nfsvers=3 set NFS to 3 version, default to 4, and CENTOS6


When you create a new directory or file, you can change the genus owner to 502;


Question: If we have the server MNT directory set to 755, and then set the configuration file to the root master group, the client root can be

Do you want to operate on a mounted directory?


Enter configuration file Vim/etc/ecports

Change:/mnt 192.168.1.106 (Rw,sync,no_root_squash)

No_root_squash restrict all except the root user

Change: chmod 755/mnt

Restart NFS:/etc/init.d/nfs restart or Exportfs-arv

Client:

Uninstall: umount/opt

Mount: Mount-e nfs-onolock,nfsvers=3 192.168.1.103:/mnt/opt


At this point we can do anything about the opt-mounted directory.



Extension: Detail http://www.cnblogs.com/mchina/archive/2012/12/18/2816717.html

= = Http://www.cnblogs.com/mchina/archive/2013/01/03/2840040.html

Detailed Parameters http://blog.chinaunix.net/uid-20628575-id-72545.html


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/74/21/wKiom1YVLWSiAiRCAACwO9FhI0g237.jpg "style=" float: none; "title=" 1.PNG "alt=" Wkiom1yvlwsiaircaacwo9fhi0g237.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/74/1E/wKioL1YVLXrh4UboAAD2Dv42mJw652.jpg "style=" float: none; "title=" 11.PNG "alt=" Wkiol1yvlxrh4uboaad2dv42mjw652.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/74/21/wKiom1YVLWSSApc2AAE8_AkzKC8205.jpg "style=" float: none; "title=" 1111.PNG "alt=" Wkiom1yvlwssapc2aae8_akzkc8205.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/74/1E/wKioL1YVLXuzm3dEAAE8_AkzKC8136.jpg "style=" float: none; "Title=" XVVBCB. PNG "alt=" Wkiol1yvlxuzm3deaae8_akzkc8136.jpg "/>






Samab Service:


Samba is a free software that implements the SMB protocol on Linux and UNIX systems, consisting of servers and client programs.

SMB (Server Messages block, information service blocks) is a way to share files and printers on a LAN

Protocol, which provides shared services for files and printers among different computers within the LAN.

We can use to achieve directory sharing between Windows and Linux;


installation: Yum install-y Samba samba-client front of the server, after for the client

Configuration file:

Workgroup = MyGroup only files in the same workgroup can be shared

Security = Users/share Safety level, former user password/latter anonymous user

Passdb bachend = TDBSAM/SMBPASSWD/LDAPLDM User Password storage method


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/74/1E/wKioL1YVLsSg7pr3AAGz5foaXmQ024.jpg "style=" float: none; "title=" 2.1.PNG "alt=" Wkiol1yvlssg7pr3aagz5foaxmq024.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/74/21/wKiom1YVLq7gUMp9AAGexjefinc107.jpg "style=" float: none; "title=" 2.2.PNG "alt=" Wkiom1yvlq7gump9aagexjefinc107.jpg "/>




Example one: share a directory, readable and non-writable?

Enter configuration file: vim/etc/samba/smb.conf

Change: Workgroup = workgroup Change to a workgroup shared with Windows

Security = share is changed to log in anonymously with no user and password required

Bottom add:


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/74/21/wKiom1YVLuOy2rGoAADgnFi9sZk982.jpg "title=" 2.4. PNG "alt=" Wkiom1yvluoy2rgoaadgnfi9szk982.jpg "/>


Test: Windows access----Open Run input \\192.168.1.103 server IP

One of Linux access---smbclient//192.168.1.103/teng server ip/Load module name

Linux Access Second---yum install-y cifs_vtils

Mount Mount-t CIFS//192.168.1.103/teng/opt


Example two: Share a directory, specify user-readable writable?

Enter configuration file: vim/etc/samba/smb.conf

Change: Security = user-Safe mode requires login for users and Passwords

Bottom add:


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/74/1E/wKioL1YVLzPywRWYAACtShK6rQ4075.jpg "title=" 2.5. PNG "alt=" Wkiol1yvlzpywrwyaactshk6rq4075.jpg "/>


Load name needs to be changed


Built system User: Useradd Smbuser1

Virtual User: Pdbedit-a Ambuser1 and System user

To view commands: Pdbedit-h

Restart Service:/ETC/INIT.D/SMB restart


Test: Enter the user name password entered in Windows Form run \\192.168.1.103\tengxun

Linux form (i) Smbclient//192.168.1.103/tengxun

or Smbclient-usmbuser1//192.168.1.103/tengxun

Linux form (ii) Mount Mount-t cifs-o username=smbuser1,passwd= Password

192.168.1.103/tengxun/opt/

View Df-h




problem: View Getenforce

Close Setenforce 0

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/74/21/wKiom1YVMRfztp31AADZHMKLFWE292.jpg "title=" GDFG. PNG "style=" Float:none; "alt=" wkiom1yvmrfztp31aadzhmklfwe292.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/74/21/wKiom1YVMYqCYfp6AADnqguL_YU948.jpg "title=" FDGD. PNG "alt=" Wkiom1yvmyqcyfp6aadnqgul_yu948.jpg "/>

Backing Up smb.conf files

The Samba server's configuration files are located in the/etc/samba directory, the server's main profile is smb.conf; there are user profiles smbpasswd, smbusers, and LMHOSTS, etc. Another file is Secrets.tdb, which is automatically generated by the Samba server startup hand


[[email protected]/] $MV/etc/samba/smb.conf/etc/samba/smb.conf.bak

[Email protected]/]$ Ls/etc/samba

Lmhosts passdb.tdb secrets.tdb Smb.conf.bak smbpasswd smbusers




Extensions: Simple http://blog.sina.com.cn/s/blog_6c9d65a10100oobp.html

detailed http://www.cnblogs.com/mchina/archive/2012/12/18/2816717.html  

Parameter http://yuanbin.blog.51cto.com/363003/115761/




650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/74/21/wKiom1YVMRew1I7lAAGJn3YDHgw661.jpg "style=" float: none; "title=" 2.PNG "alt=" Wkiom1yvmrew1i7laagjn3ydhgw661.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/74/1E/wKioL1YVMS3wINZAAAEB9TNZps4221.jpg "style=" float: none; "title=" 22.PNG "alt=" Wkiol1yvms3winzaaaeb9tnzps4221.jpg "/>






Day 23rd: Configuring NFS and Samba Services

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.