Samba Services Simple Setup

Source: Internet
Author: User

[Samba]

Service side:
#yum install-y Samba Samba-client Samba-common
#mkdir/westos
#touch/westos/sambafile
#vim/etc/samba/smb.conf
#useradd-S/sbin/nologin Chengcheng
#smbpasswd-A Chengcheng
#chown-R Chengcheng/westos
#vim/etc/samba/smb.conf
[Hello]
Comment = Local
Path =/westos
Guest OK = yes//Allow anonymous user login
writeable = yes//any user can write and upload files
#systemctl Restart Smb.sevice
#客户端: Yum install-y samba-client
#smbclient//ip/hello-u Chengcheng
SMB: \> put file
SMB: \> get File1
SMB: \> RM file10//Note Here Delete cannot use RM-RF
This will enable real-name users to upload and download
Down for anonymous user access
[Hello]
Comment = Local
Path =/westos
Guest OK = yes//Allow anonymous user login
writeable = yes//any user can write and upload files
In security = user Passdb backend = Tdbsam
Added: Map to guest = Bad user
Restarting the SMB service
#systemctl Restart Smb.sevice
#smbclient//ip/hello
SMB: \> put file
SMB: \> get File1
SMB: \> RM file10

Valid users = Test//Represents a valid user, @groupname or +groupname a user who is not in a group group cannot log on.
Admin users = Test//This indicates that the normal user will be the root of the upload download, delete
Write list = test//writable in the user list

Samba Multi-user mount
#mount-T Cifs-o username=test,password=123456//172.25.254.164/hello/mnt
#df-H
Settings that are automatically hung
#vim/etc/fstab
172.25.254.164/hello/mnt CIFS defaults,username=test,password=123456 0 0
#注意这样不 * * * Full
172.25.254.164/hello/mnt CIFS credentials=/root/userpasswd 0 0
#vim/root/userpasswd
User=test
pass=123456

[SMB Multi-user Mount]
Install the Cifs-utils package, which contains the cifscreds command
# yum Install-y cifs-utils
To create an SMB multi-user mount directory:
# Mkdir/mnt/multiuser
To establish an SMB authentication file:
# echo ' username=test ' >/root/smb-multiuser.txt
# echo ' password=123456 ' >/root/smb-multiuser.txt
Edit/etc/fstab to permanently mount the SMB share:
Server0/smbshare/mnt/multiuser CIFS Credentials=/root/smb-multiuser.txt,multiuser,
SEC=NTLMSSP 0 0
# mount-a
# Su-test
$ touch/mnt/multiuser/test.txt
Touch:cannot Touch '/mnt/multiuser/test.txt ': Permission denied
$ cifscreds Add Server0
Password:redhat
$ echo "multiuser" >/mnt/multiuser/test.txt
$ cat/mnt/multiuser/test.txt
Multiuser
$ exit
# Su-cheng
$ cifscreds Add Server0
Password:redhat
$ echo "multiuser" >/mnt/multiuser/cheng.txt
-bash:/mnt/multiuser/cheng.txt:permission denied
$ cat/mnt/multiuser/brian.txt
Multiuser
//


This article from "Love You in Time" blog, reprint please contact the author!

Samba Services Simple Setup

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.