[Draft] Samba, draft samba

Source: Internet
Author: User

[Draft] Samba, draft samba

Samba user management:
Add samba users:
Pdbedit-a username
Delete samba users:
Pdbedit-x username
View samba users:
Pdbedit-L

Samba skills:
Share the soft connection in the samba shared directory:
Edit/etc/samba/smb. conf
Append the following content to [global:
Follow symlinks = yes
Wide links = yes
Unix extensions = no


Samba sharing Configuration

Step 1: Add users

Useradd-M-s/sbin/nologin shera1
Useradd-M-s/sbin/nologin shera2
Smbpasswd-a shera1
Smbpasswd-a shera2
Step 2: Prepare the shared directory (assuming the shared directory is/share)
Mkdir-m 755-Z unconfined_u: object_r: samba_assist_t: s0/share
Chwon shera2/share
Setsebool samba_create_home_dirs on
Setsebool samba_export_all_rw on
Step 3: Install samba & modify the samba configuration file
Yum-y install samba -*
Chkconfig smb on

Echo [global]>/etc/samba/smb. conf
Echo workgroup = MYGROUP>/etc/samba/smb. conf
Echo server string = Samba Server Version % v>/etc/samba/smb. conf

Echo security = user>/etc/samba/smb. conf
Echo passdb backend = tdbsam>/etc/samba/smb. conf
Echo [share]>/etc/samba/smb. conf
Echo comment = test>/etc/samba/smb. conf
Echo path =/share>/etc/samba/smb. conf
Echo read only = yes>/etc/samba/smb. conf
Echo write list = shera2>/etc/samba/smb. conf
Echo browseable = yes>/etc/samba/smb. conf
Service smb restart

* Note: All commands must be executed as root. This method is only applicable to CentOS, Fedora, RHEL, and other systems.

How does samba set in Linux?

Hello, let me give you an example of settings. You can easily build your samba server by taking my example:
Environment requirements: assume that the IP address of the VM (samba server) is 192.168.1.1, and the client is the IP address 192.168.1.2 of the real machine. If the two can be pinged, we will do the following:
[Root @ Desktop] # mkdir/share
[Root @ Desktop] # vi/etc/samba/smb. conf
[Root @ Desktop] # sambapasswd root
[Root @ Desktop] # admin <enter the password>
[Root @ Desktop] # admin <repeated password input>
Add the following lines to the smb. conf configuration file:
[Share]
Comment = share
Path =/share
Public = yes
(Accessible to anyone)
[Root @ Desktop] # service smb reload
Reload: Do not restart, generally do not restart in real life;
Test: running \ 192.168.1.1 \ share in windows XP
A logon window is displayed. Enter the username, root password, and admin to enter the linux samba shared directory. This indicates that the file has been shared successfully.
I hope my answers will help you. If you have any questions, you can add me 69964882 or visit my website www.chlinux.com.

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.