botang 发表于 2019-5-30 21:12:00

课程第22次

samba自动挂载:/etc/auto.master:
#
# Sample auto.master file
# This is a 'master' automounter map and it has the following format:
# mount-point :]map
# For details of the format look at auto.master(5).
#
/misc   /etc/auto.misc
/sambaclient/etc/auto.test
#
# NOTE: mounts done from a hosts map will be mounted with the
#       "nosuid" and "nodev" options unless the "suid" and "dev"
#       options are explicitly given.
#
/net    -hosts
#
# Include /etc/auto.master.d/*.autofs
# The included files must conform to the format of this file.
#
+dir:/etc/auto.master.d
#
# Include central master map if it can be found using
# nsswitch sources.
/etc/auto.test:
test    -fstype=cifs,username=frank,credentials=/root/linux.txt ://192.168.0.61/mydata或者:
test    -fstype=cifs,username=frank,username=frank,password=frankredhat ://192.168.0.61/mydata凭空cd /sambaclient/test

-------------------------------------------------------------
-bash-4.2# ls -ld /sambagroup/
drwxrwsr-x. 2 root sharedg 4096 May 30 09:44 /sambagroup/
/etc/samba/smb.conf:

      workgroup = SAMBA
      security = user

      passdb backend = tdbsam

      printing = cups
      printcap name = cups
      load printers = yes
      cups options = raw
      hosts allow =192.168.0., 127.0.0.1


      comment = Home Directories
      valid users = %S, %D%w%S
      browseable = Yes
      read only = No
      inherit acls = Yes


      comment = All Printers
      path = /var/tmp
      printable = Yes
      create mask = 0600
      browseable = No


      comment = Printer Drivers
      path = /var/lib/samba/drivers
      write list = @printadmin root
      force group = @printadmin
      create mask = 0664
      directory mask = 0775



       comment = mydata
       path=/sambaserver
       browseable=yes
       writeable=yes


       comment = groupdata
       path=/sambagroup
       browseable=yes
       writeable=yes
       create mask = 0775
~
                                    


页: [1]
查看完整版本: 课程第22次