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: win7, puttyssh client 2. install samba: yum-yinstallsamba3. create the shared directory mkdir/home/linuxchmod
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:
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 centos samba cannot access any folder by default, you must change the security attribute of the folder to obtain the access permission. Otherwise, you cannot access the shared directory (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 linuxpath =/home/program // This user can access public = nobrowseable = 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 the 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:
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:
Enter the user name and password.