Samba shared on-line measurement

Source: Internet
Author: User
Tags deprecated

Environment:

Host: 192.168.1.82

Version: Samba-version 4.1.6

Installation directory:/usr/local/samba/

Configuration file:/usr/local/samba/etc/smb.conf

Service Start command:/usr/local/samba/sbin/smbd-d

A complete Samba account add process:

1. Add a System User

Useradd-g 571-m Bailu # #571为www组的ID-M do not create user home directory

2. Add a Samba account

/usr/local/samba/bin/pdbedit-a Bailu # #会提示输入密码两次/usr/local/samba/bin/pdbedit-l # #查看用户


3. Create a shared directory

Mkdir-pv/home/www/server/selftest/bailu Chown Www.www/home/www/server/selfTest/bailu


         4. Modify the Samba configuration file add share

             [bailu]                          comment = bailu                         path = /home/www/server/ selftest/bailu                         browseable = yes                          writable = yes                         valid users = bailu, @www

5. Restart the server

Pkill-9 smdb;/usr/local/samba/sbin/smbd-d

Enter the \\192.168.1.82\bailu test above the Win8 folder

Global configuration file:

[global]        workgroup = mygroup         server string = Samba Server         netbios name = davidsamba        server  role = standalone server        log file  = /var/log/samba/log.%m # scurity can be set to user, share (deprecated)  or server (deprecated)         security =  user        passdb backend = smbpasswd#        dns proxy = no[homes]         comment = Home Directories         Browseable = no        writable = yes         valid users = %s        valid users =  mydomain\%s[bailu]        comment = bailu         path = /home/www/server/selfTest/bailu         browseable = yes        writable =  yes        valid users = bailu, @www

Bulk add script for system users

#!/bin/bash### #smaba user add##### #默认添加密码为username123 ##### #用户名放在同级目录下的user. line file, one subscriber per row # # #sum =0cur_dir=$ (PWD) For I in $ (cat $Cur _dir/user.line) do ID $i >&/dev/null if [$?-ne 0];thenuseradd-g 571-m $i &&G T;/dev/nullecho $i "123" |    passwd--stdin $i >&/dev/nulllet sum+=1 elseecho "User $i already exists!" Fidoneecho "$sum Users add++"


This article is from the "Tongluowan" blog, make sure to keep this source http://wuhf2015.blog.51cto.com/8213008/1716480

Samba shared on-line measurement

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.