Recently, the company developed software projects and shared documents of the entire team are stored in a unified manner to facilitate development. Therefore, we have built a samba file server. Below we record the simple steps for future reference, shared with you.
1. Basic information:
Server: IBM
Operating System: centos
Server Software: samba
Client: win 7, putty ssh client
2. Install samba:
yum -y install samba
3. Create a shared directory
mkdir /home/linuxchmod -R 777 /home/linux
4. Grant the shared file directory access permission
chcon -R -t samba_share_t /home/linux
Modify the Security Attribute of the shared directory. Because the default samba of centos cannot access any folder, you must change the Security Attribute of the folder to obtain the access permission. Otherwise, you cannot access the key)
5. Add the samba user name and password
Useradd sgd // Add the user name passwd sgd to the system // Add the password smbpasswd-a sgd to the user name // Add the user to the samba server
6. modify the configuration file smb. conf.
[Global] workgroup = WORKGROUP // modified the Working Group and the name of the file server in the same working group server string = program linux % v //
The user configuration can be written like this, but it can be used anyway:
[Program-linux] comment = program linux path =/home/program // This user can access public = no browseable = yes // can read, view writable = yes // can write valid users = sgd // username create mode = 1777 // create File Permission force create mode = 1777 directry mode = 1777 // create folder permission force directry mode = 1777
If you want to grant different permissions to users, you can modify the preceding configurations, such as writing, reading, and copying.
7. Modify the Firewall Configuration:
/Sbin/iptables-I input-p tcp -- dport 139-j ACCEPT/sbin/iptables-I INPUT-p tcp -- dport 445-j ACCEPT/save firewall configuration/etc/ rc. d/init. d/iptables save // restart/etc/rc. d/init. d/iptables restart or start/etc/rc. d/init. d/iptables start
8. Add boot start:
chkconfig smb on
9. Start the samba service:
/Etc/rc. d/init. d/smb start // or restart/etc/rc. d/init. d/smb restart
10. Access in win 7:
\\192.168.3.234
Enter the user name and password
This article from the "LinuxQt Jinan High-Tech Zone" blog, please be sure to retain this source http://qtlinux.blog.51cto.com/3052744/1301992