Configure SAMBA in CentOS to share linux Files in windows

Source: Internet
Author: User

 

To facilitate the upgrade of the deployed application, you can configure samba in linux to implement the application directory of windows Shared linux, which simplifies and speeds up application upgrade and deployment in the future.

[Root @ tomcat ~] # Uname-

Linux tomcat 2.6.9-89. ELsmp #1 SMP Mon Jun 22 12:32:43 EDT 2009 i686 i686 i386 GNU/Linux

[Root @ tomcat ~] # Cat/etc/issue

CentOS release 4.8 (Final)

Kernel \ r on an \ m

 

[Root @ tomcat ~] # Rpm-qa | grep sam

Samba-3.0.33-0.17.el4

Samba-client-3.0.33-0.17.el4

System-config-samba-1.2.21-1.el4.1

Samba-common-3.0.33-0.17.el4

[Root @ tomcat ~] # Find/-name smb. conf

/Etc/samba/smb. conf

 

The configuration file to be modified is/etc/samba/smb. conf. Add the following lines:

[Tomcat]; just give the name you want

Path =/opt/tomcat; shared directory

Valid users = tomcat; shared Login User

Public = no;

Writable = yes; whether to allow write

Printable = no;

Create mask = 0765; default permission for creating a file directory

Www.2cto.com

After setting, you can use testparm to verify the configuration file.

[Root @ tomcat ~] # Testparm

Load smb config files from/etc/samba/smb. conf

Processing section "[printers]"

Processing section "[tomcat]"

Loaded services file OK.

Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

 

[Global]

Workgroup = MYGROUP

Server string = Samba Server Version % v

Passdb backend = tdbsam

Idmap uid = 16777216-33554431

Idmap gid = 16777216-33554431

Cups options = raw

.....

.....

 

Set the access user and password

[Root @ tomcat ~] # Smbpasswd tomcat

Enter the password you want to set. Note that this user password is used during win access, and the user may already exist. For example, here I am using the application user.

 

Disable Firewall

[Root @ tomcat ~] # Service iptables stop

Disable Firewall

[Root @ tomcat ~] # Chkconfig iptables off

 

Start SMB manually

[Root @ tomcat ~] # Service smb start

Start the SMB service:

Start NMB service:

Configure SMB auto-start

[Root @ tomcat ~] # Chkconfig smb on

OK. You can enter \ ip on the win client to access the shared directory provided by linux.

-The End-

 

From Gtlions

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.