精华内容
下载资源
问答
  • samba

    2019-12-17 09:45:23
    samba windows下相关软件 Xmanager 安装 yum install -y samba 添加新的用户当做samba,或忽略此步骤 useradd samba passwd samba 即新建一个linxu用户 修改samba配置 sudo vi /etc/samba/smb.conf ...[sh...

    samba

    windows下相关软件

    Xmanager
    先启动Xmanager-Passive,再启动Xshell连接linux
    也可以不用该软件,直接在linux环境下配置

    安装

    yum install -y samba
    

    添加新的系统用户来当做samba用户,或忽略此步骤

    useradd samba
    passwd samba
    

    即新建一个linxu用户

    修改samba配置

    sudo vi /etc/samba/smb.conf
    
    share
    [Global]
    	security = share
    ...
    
    #add
    [share]
    	comment = comment
    	path = /share
    	available = yes
    	browseable = yes
    	public = yes
    	writable = yes
    
    user
    # add
    [share]
    	comment = comment
    	path = /share
    	available = yes
    	browseable = yes
    	public = no
    	writable = yes
    	# valid users = samba 	# 允许访问linux共享目录的用户,此用户需是linux的samba用户
    	# create mask = 0765 	# 在共享目录上建立的文件的权限
    	# printable = no 		# 若设为yes,则被认定为打印机
    

    创建目录

    mkdir /share
    chmod 777 /share
    

    添加上述创建用户或其他存在于系统中的用户为samba用户

    sudo smbpasswd -a samba
    

    重启samba服务

    sudo service smb restart #有的是smbd
    

    windows访问

    在Windows资源管理器地址栏输入Linux主机的IP

    映射为盘

    net use X: \\Linux服务器IP地址\share	#这个share是在conf文件里设置的[share]
    

    常见问题

    不允许一个用户使用一个以上用户名与一个服务器或共享资源的多重连接

    cmd

    net use 			#查看当前连接
    net use * /del /y 	#关闭连接
    
    Windows 下访问 Linux 下共享目录 , 提示没有权限
    1. 确保 Linux 下防火墙关闭或者是开放共享目录权限
    2. 确保 Samba 服务器配置文件 smb.conf 设置没有问题
    3. 确保 setlinux 关闭 , 可以用 setenforce 0 命令执行; 默认 SELinux 禁止网络上对 Samba 服务器上的共享目录进行写操作

    Samb 还需要开放下面四个端口

    UDP 137、UDP 138、TCP 139、TCP 445
    
    展开全文
  • # Sample configuration file for the Samba suite for Debian GNU/Linux. # # # This is the main Samba configuration file. You should read the # smb.conf(5) manual page in order to understand the o
    #
    
    # Sample configuration file for the Samba suite for Debian GNU/Linux.
    #
    #
    # This is the main Samba configuration file. You should read the
    # smb.conf(5) manual page in order to understand the options listed
    # here. Samba has a huge number of configurable options most of which 
    # are not shown in this example
    #
    # Some options that are often worth tuning have been included as
    # commented-out examples in this file.
    #  - When such options are commented with ";", the proposed setting
    #    differs from the default Samba behaviour
    #  - When commented with "#", the proposed setting is the default
    #    behaviour of Samba but the option is considered important
    #    enough to be mentioned here
    #
    # NOTE: Whenever you modify this file you should run the command
    # "testparm" to check that you have not made any basic syntactic 
    # errors. 
    # A well-established practice is to name the original file
    # "smb.conf.master" and create the "real" config file with
    # testparm -s smb.conf.master >smb.conf
    # This minimizes the size of the really used smb.conf file
    # which, according to the Samba Team, impacts performance
    # However, use this with caution if your smb.conf file contains nested
    # "include" statements. See Debian bug #483187 for a case
    # where using a master file is not a good idea.
    #


    #======================= Global Settings =======================


    [global]


    ## Browsing/Identification ###


    # Change this to the workgroup/NT-domain name your Samba server will part of
       workgroup = WORKGROUP


    # server string is the equivalent of the NT Description field
       server string = %h server


    # Windows Internet Name Serving Support Section:
    # WINS Support - Tells the NMBD component of Samba to enable its WINS Server
    #   wins support = no


    # WINS Server - Tells the NMBD components of Samba to be a WINS Client
    # Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
    ;   wins server = w.x.y.z


    # If we receive WINS server info from DHCP, override the options above. 
       include = /etc/samba/dhcp.conf


    # This will prevent nmbd to search for NetBIOS names through DNS.
       dns proxy = no


    # What naming service and in what order should we use to resolve host names
    # to IP addresses
    ;   name resolve order = lmhosts host wins bcast


    #### Networking ####


    # The specific set of interfaces / networks to bind to
    # This can be either the interface name or an IP address/netmask;
    # interface names are normally preferred
    ;   interfaces = 127.0.0.0/8 eth0


    # Only bind to the named interfaces and/or networks; you must use the
    # 'interfaces' option above to use this.
    # It is recommended that you enable this feature if your Samba machine is
    # not protected by a firewall or is a firewall itself.  However, this
    # option cannot handle dynamic or non-broadcast interfaces correctly.
    ;   bind interfaces only = yes






    #### Debugging/Accounting ####


    # This tells Samba to use a separate log file for each machine
    # that connects
       log file = /var/log/samba/log.%m


    # Cap the size of the individual log files (in KiB).
       max log size = 1000


    # If you want Samba to only log through syslog then set the following
    # parameter to 'yes'.
    #   syslog only = no


    # We want Samba to log a minimum amount of information to syslog. Everything
    # should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log
    # through syslog you should set the following parameter to something higher.
       syslog = 0


    # Do something sensible when Samba crashes: mail the admin a backtrace
       panic action = /usr/share/samba/panic-action %d




    ####### Authentication #######


    # "security = user" is always a good idea. This will require a Unix account
    # in this server for every user accessing the server. See
    # /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html
    # in the samba-doc package for details.
    #   security = user


    # You may wish to use password encryption.  See the section on
    # 'encrypt passwords' in the smb.conf(5) manpage before enabling.
       encrypt passwords = true


    # If you are using encrypted passwords, Samba will need to know what
    # password database type you are using.  
       passdb backend = tdbsam


       obey pam restrictions = yes


    # This boolean parameter controls whether Samba attempts to sync the Unix
    # password with the SMB password when the encrypted SMB password in the
    # passdb is changed.
       unix password sync = yes


    # For Unix password sync to work on a Debian GNU/Linux system, the following
    # parameters must be set (thanks to Ian Kahan <<kahan@informatik.tu-muenchen.de> for
    # sending the correct chat script for the passwd program in Debian Sarge).
       passwd program = /usr/bin/passwd %u
       passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .


    # This boolean controls whether PAM will be used for password changes
    # when requested by an SMB client instead of the program listed in
    # 'passwd program'. The default is 'no'.
       pam password change = yes


    ########## Domains ###########


    # Is this machine able to authenticate users. Both PDC and BDC
    # must have this setting enabled. If you are the BDC you must
    # change the 'domain master' setting to no
    #
    ;   domain logons = yes
    #
    # The following setting only takes effect if 'domain logons' is set
    # It specifies the location of the user's profile directory
    # from the client point of view)
    # The following required a [profiles] share to be setup on the
    # samba server (see below)
    ;   logon path = \\%N\profiles\%U
    # Another common choice is storing the profile in the user's home directory
    # (this is Samba's default)
    #   logon path = \\%N\%U\profile


    # The following setting only takes effect if 'domain logons' is set
    # It specifies the location of a user's home directory (from the client
    # point of view)
    ;   logon drive = H:
    #   logon home = \\%N\%U


    # The following setting only takes effect if 'domain logons' is set
    # It specifies the script to run during logon. The script must be stored
    # in the [netlogon] share
    # NOTE: Must be store in 'DOS' file format convention
    ;   logon script = logon.cmd


    # This allows Unix users to be created on the domain controller via the SAMR
    # RPC pipe.  The example command creates a user account with a disabled Unix
    # password; please adapt to your needs
    ; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u


    # This allows machine accounts to be created on the domain controller via the 
    # SAMR RPC pipe.  
    # The following assumes a "machines" group exists on the system
    ; add machine script  = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u


    # This allows Unix groups to be created on the domain controller via the SAMR
    # RPC pipe.  
    ; add group script = /usr/sbin/addgroup --force-badname %g


    ########## Printing ##########


    # If you want to automatically load your printer list rather
    # than setting them up individually then you'll need this
    #   load printers = yes


    # lpr(ng) printing. You may wish to override the location of the
    # printcap file
    ;   printing = bsd
    ;   printcap name = /etc/printcap


    # CUPS printing.  See also the cupsaddsmb(8) manpage in the
    # cupsys-client package.
    ;   printing = cups
    ;   printcap name = cups


    ############ Misc ############


    # Using the following line enables you to customise your configuration
    # on a per machine basis. The %m gets replaced with the netbios name
    # of the machine that is connecting
    ;   include = /home/samba/etc/smb.conf.%m


    # Most people will find that this option gives better performance.
    # See smb.conf(5) and /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/speed.html
    # for details
    # You may want to add the following on a Linux system:
    #         SO_RCVBUF=8192 SO_SNDBUF=8192
    #   socket options = TCP_NODELAY


    # The following parameter is useful only if you have the linpopup package
    # installed. The samba maintainer and the linpopup maintainer are
    # working to ease installation and configuration of linpopup and samba.
    ;   message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm %s' &


    # Domain Master specifies Samba to be the Domain Master Browser. If this
    # machine will be configured as a BDC (a secondary logon server), you
    # must set this to 'no'; otherwise, the default behavior is recommended.
    #   domain master = auto


    # Some defaults for winbind (make sure you're not using the ranges
    # for something else.)
    ;   idmap uid = 10000-20000
    ;   idmap gid = 10000-20000
    ;   template shell = /bin/bash


    # The following was the default behaviour in sarge,
    # but samba upstream reverted the default because it might induce
    # performance issues in large organizations.
    # See Debian bug #368251 for some of the consequences of *not*
    # having this setting and smb.conf(5) for details.
    ;   winbind enum groups = yes
    ;   winbind enum users = yes


    # Setup usershare options to enable non-root users to share folders
    # with the net usershare command.


    # Maximum number of usershare. 0 (default) means that usershare is disabled.
    ;   usershare max shares = 100


    #======================= Share Definitions =======================


    [homes]
       comment = Home Directories
       browseable = no
       writable = yes


    # By default, the home directories are exported read-only. Change the
    # next parameter to 'no' if you want to be able to write to them.
       read only = yes


    # File creation mask is set to 0700 for security reasons. If you want to
    # create files with group=rw permissions, set next parameter to 0775.
       create mask = 0700


    # Directory creation mask is set to 0700 for security reasons. If you want to
    # create dirs. with group=rw permissions, set next parameter to 0775.
       directory mask = 0700


    # By default, \\server\username shares can be connected to by anyone
    # with access to the samba server.
    # The following parameter makes sure that only "username" can connect
    # to \\server\username
    # This might need tweaking when using external authentication schemes
    #   valid users = %S


    # Un-comment the following and create the netlogon directory for Domain Logons
    # (you need to configure Samba to act as a domain controller too.)
    ;[netlogon]
    ;   comment = Network Logon Service
    ;   path = /home/samba/netlogon
    ;   guest ok = yes
    ;   read only = yes
    ;   share modes = no


    # Un-comment the following and create the profiles directory to store
    # users profiles (see the "logon path" option above)
    # (you need to configure Samba to act as a domain controller too.)
    # The path below should be writable by all users so that their
    # profile directory may be created the first time they log on
    ;[profiles]
    ;   comment = Users profiles
    ;   path = /home/samba/profiles
    ;   guest ok = no
    ;   browseable = no
    ;   create mask = 0600
    ;   directory mask = 0700


    [printers]
       comment = All Printers
       browseable = no
       path = /var/spool/samba
       printable = yes
       guest ok = no
       read only = yes
       create mask = 0700


    # Windows clients look for this share name as a source of downloadable
    # printer drivers
    [print$]
       comment = Printer Drivers
       path = /var/lib/samba/printers
       browseable = yes
       read only = yes
       guest ok = no
    # Uncomment to allow remote administration of Windows print drivers.
    # You may need to replace 'lpadmin' with the name of the group your
    # admin users are members of.
    # Please note that you also need to set appropriate Unix permissions
    # to the drivers directory for these users to have write rights in it
    ;   write list = root, @lpadmin


    # A sample share for sharing your CD-ROM with others.
    ;[cdrom]
    ;   comment = Samba server's CD-ROM
    ;   read only = yes
    ;   locking = no
    ;   path = /cdrom
    ;   guest ok = yes


    # The next two parameters show how to auto-mount a CD-ROM when the
    # cdrom share is accesed. For this to work /etc/fstab must contain
    # an entry like this:
    #
    #       /dev/scd0   /cdrom  iso9660 defaults,noauto,ro,user   0 0
    #
    # The CD-ROM gets unmounted automatically after the connection to the
    #
    # If you don't want to use auto-mounting/unmounting make sure the CD
    # is mounted on /cdrom
    #
    ;   preexec = /bin/mount /cdrom
    ;   postexec = /bin/umount /cdrom


    #this is new orders by myself, you can delete them 


    [global]
    #      workgroup =
          server string = %h server
          log file = /var/log/samba/log.%m
          refresh = 1
          max log size = 1000
          syslog = 0
          encrypt passwords = yes
          passwd program = /usr/bin/passwd %u
          passwd chat = *Enter/snew/Sunix/spassword:* %n/n *Retype/snew/sUNIX/spassword:* %n/n *password/supdated/ssuccessfully*.
          socket options = TCP_NODELAY
     
    [tmp]
          comment = Temporary file space
          path = /tmp
          read only = no
          public = yes
     
    #[homes]
    #    comment = Home Directories
          browseable = no
          writable = yes
          create mask = 0700
          directory mask = 0700
    #    valid users = %s


    [debian]
        comment = debian
        browseable = yes
        read only = no 
        writable = yes
        valid users = root
        path = /



    ======================================================================

    以下是配置完成后的smbpasswd文件操作步骤,否则smb无法访问。

    1)       测试配置testparm

    2)       重启samba服务。/etc/init.d/samba restart

    3)       创建用户密码文件。touch /etc/samba/smbpasswd

    4)       创建用户:smbpasswd –a [用户名]。用户名推荐用root

    5)       输入密码完成创建

    6)       在window输入IP访问


     
    展开全文
  • samba 共享目录无法访问 解决方法总结 (2013-11-08 16:02:58)转载▼ 分类: LINUX 1)关闭防火墙: #sevice iptables stop 2)修改 /etc/samba/smb.conf,具体配置网上有,我的如下: security = sh...
    samba 共享目录无法访问 解决方法总结 (2013-11-08 16:02:58)转载▼
    
    分类: LINUX
    1)关闭防火墙: #sevice iptables stop

    2)修改 /etc/samba/smb.conf,具体配置网上有,我的如下:

    security = share ---- 这个要用上,share表示安全最低级别,其次是user,最高是server

    [共享目录名]
    path = /home/用户名/共享目录名
    ;read only = no -----这个需要在前面用分号注释掉
    writeable = yes
    browseable = yes
    public = yes
    guest ok = yes

    3)SELinux作怪
    修改/etc/sysconfig/selinux 把enforcing改成disabled;然后命令行setenforce 0;
    或者用Rainsome兄说的 使用selinux强制策略:chcon -R -t samba_share_t /home/suyang/"Fedora Samba"

    4)修改目录权限 #chmod 777 /home/wind ; #chmod 777 /home/wind/smbShare; 特别是前面一个做为上层目录权限也需要修改!!!!

    5)重启samba服务 #service smb restart 或者 /etc/rc.d/init.d/smb restart

    结束。 当然你要在linux与windows之间互相能ping 通。
    展开全文
  • Samba

    2020-10-13 20:52:14
    SMB协议是C/S(客户机/服务器)型协议,客户机通过该协议可以访问服务器上的共享文件系统、打印机及其他资源。 samba是能够在任何支持SMB协议的主机之间共享文件的一种实现,当然也包括windows。

    Samba

    Samba简介

    • Samba是在Linux和UNIX系统上实现SMB协议的一个免费软件,由服务器及客户端程序构成。SMB(Server Messages Block,信息服务块)是一种在局域网上共享文件和打印机的一种通信协议,它为局域网内的不同计算机之间提供文件及打印机等资源的共享服务。SMB协议是C/S(客户机/服务器)型协议,客户机通过该协议可以访问服务器上的共享文件系统、打印机及其他资源。

    • samba是能够在任何支持SMB协议的主机之间共享文件的一种实现,当然也包括windows。

    • Samba监听端口有:

      • TCP
        • 139
        • 445
      • TCP端口相对应的服务是smbd服务,其作用是提供对服务器中文件、打印资源的共享访问。
      • UDP
        • 137
        • 138
      • UDP端口相对应的服务是nmbd服务,其作用是提供基于NetBIOS主机名称的解析。
    • Samba的进程

    进程对应
    nmbd对应netbios
    smbd对应cifs协议
    winbindd + ldap对应Windows AD活动目录
    • Samba用户
    账户密码
    /etc/passwd中的系统账号Samba服务自有密码文件通过smbpasswd -a USERNAME命令设置
    • smbpasswd常用命令

      • -a Sys_User #添加系统用户为samba用户并为其设置密码
      [root@server ~]# id xx
      uid=993(xx) gid=298(xx) groups=298(xx)
      [root@server ~]# smbpasswd -a xx
      New SMB password:
      Retype new SMB password:
      Added user xx.
      
      • -d #禁用共享帐号
      • -e #启用共享帐号
      • -x #删除共享帐号
    • Samba安全级别

    安全级别作用
    user基于本地的验证
    server由另一台指定的服务器对用户身份进行认证
    domain由域控进行身份验证

    注: 以前的samba版本支持的安全级别有四个,分别是share,user,server,domain,share是用来设置匿名访问的,但现在的版本已经不支持share了,但是还是可以实现匿名访问的,只是配置方式变了。

    • Samba配置文件
      • /etc/samba/smb.conf(主配置文件)
    • 配置文件组成详解:
    组成作用
    [global]全局配置,此处的设置项对整个samba服务器都有效
    [homes]家目录共享设置,此处用来设置Linux用户的默认共享,对应用户的家目录。当用户访问服务器中与自己用户名同名的共享目录时,通过验证后将会自动映射到该用户的家目录中
    [printers]打印机共享设置
    • 常用配置文件参数
    参数作用
    workgroup表示设置工作组名称
    server string表示描述samba服务器
    security表示设置安全级别,其值可为share、user、server、domain
    passdb backend表示设置共享帐户文件的类型,其值可为tdbsam(tdb数据库文件)、ldapsam(LDAP目录认证)、smbpasswd(兼容旧版本samba密码文件)
    comment表示设置对应共享目录的注释,说明信息,即文件共享名
    browseable表示设置共享是否可见
    writable表示设置目录是否可写
    path表示共享目录的路径
    guest ok表示设置是否所有人均可访问共享目录
    public表示设置是否允许匿名用户访问
    hosts allow设置允许哪台主机访问,例如 hosts allow = 192.168.72.2
    write list表示设置允许写的用户和组,组要用@表示,例如 write list = root,@root
    valid users设置可以访问的用户和组,例如 valid users = root,@root
    hosts deny设置拒绝哪台主机访问,例如 hosts deny = 192.168.72.1
    printable表示设置是否为打印机
    • 配置完成后可以使用testparm命令来检查配置文件是否有语法错
    [root@server cwt]# testparm 
    Load smb config files from /etc/samba/smb.conf
    Loaded services file OK.
    Weak crypto is allowed
    Server role: ROLE_STANDALONE
    

    Samba访问

    • 环境说明
      • 服务器IP:192.168.86.129
      • 客户机IP:192.168.86.132

    注意: 服务器上需要安装samba,客户机上需要安装samba-client

    [root@server ~]# yum -y install samba*
    [root@client ~]# yum -y install samba-client
    
    • 交互式访问
    //查看服务器共享目录
    [root@client ~]# smbclient -L 192.168.86.129 -U cwt
    Enter SAMBA\cwt's password: 
    
    	Sharename       Type      Comment
    	---------       ----      -------
    	shares          Disk      
    	IPC$            IPC       IPC Service (Samba 4.11.2)
    	cwt             Disk      Home Directories
    
    //交互式访问共享资源
    [root@client ~]# smbclient //192.168.86.129/shares -U cwt
    Enter SAMBA\cwt's password: 
    Try "help" to get a list of possible commands.
    smb: \> ls
      .                                   D        0  Tue Oct 13 11:31:38 2020
      ..                                  D        0  Mon Oct 12 19:31:01 2020
      ssh_key                             D        0  Tue Oct 13 13:44:22 2020
      9x9.sh                              N      118  Thu Oct  1 09:51:08 2020
      httpd                               D        0  Tue Oct 13 11:30:57 2020
    
    		36727276 blocks of size 1024. 34369456 blocks available
    		
    //基于挂载的方式访问
    [root@client ~]# mount -t cifs //192.168.86.129/shares /mnt/ -o username=cwt,password=123
    [root@client ~]# df -h|grep mnt
    //192.168.86.129/shares   36G  2.3G   33G   7% /mnt
    
    
    //开机自动挂载,需要修改/etc/fstab配置文件,在配置文件中添加下面这一行内容即可
    [root@client ~]# vim /etc/fstab 
    //192.168.86.129/shares /mnt cifs defaults,username=cwt,password=123 0 0
    

    示例

    • 配置用户认知共享
    //安装samba服务
    略
    
    //启动服务
    [root@server ~]# systemctl start nmb smb
    
    //映射共享目录:
    //创建用户cwt
    [root@server ~]# useradd -r -M -s /sbin/nologin cwt
    
    //为cwt用户创建smb共享密码
    [root@server ~]# smbpasswd -a cwt
    New SMB password:
    Retype new SMB password:
    Added user cwt.
    
    //假设这里映射的用户为xx用户,那么就需要在/etc/samba/smbusers文件中添加以下内容:
    [root@server ~]# vim /etc/samba/smbusers
    cwt = xx
    
    //修改etc/samba/smb.conf配置文件,在全局配置中添加以下内容
    [root@server ~]# vim /etc/samba/smb.conf
    
    # See smb.conf.example for a more detailed config file or
    # read the smb.conf manpage.
    # Run 'testparm' to verify the config is correct after
    # you modified it.
    
    [global]
            workgroup = SAMBA
            security = user
            username map = /etc/samba/smbusers             #添加这一行参数
            
    //创建共享目录
    [root@server ~]# mkdir /opt/tank
    [root@server ~]# chown -R cwt.cwt /opt/tank/
    
    //配置共享
    [root@server ~]# vim /etc/samba/smb.conf          #在配置文件中添加如下内容
    
    [cwt]
            path = /opt/tank       
            browseable = Yes
            guest ok = Yes
            writable = Yes
            writable list = xx
            public = Yes
            
    //重启服务
    [root@server ~]# systemctl restart smb nmb
    
    //在客户端上查看共享资源
    [root@client ~]# smbclient -L 192.168.86.129 -U xx
    Enter SAMBA\xx's password: 
    
    	Sharename       Type      Comment
    	---------       ----      -------
    	cwt             Disk      
    	IPC$            IPC       IPC Service (Samba 4.11.2)
    	
    //挂载共享资源
    [root@client ~]# mount -t cifs //192.168.86.129/cwt /mnt -o username=xx,password=123
    [root@client ~]# df -h|grep mnt
    //192.168.86.129/cwt      36G  2.3G   33G   7% /mnt
    
    //从客户机上进入共享目录创建新文件
    [root@client ~]# cd /mnt/
    [root@client mnt]# touch 12
    [root@client mnt]# ls
    12  hello
    
    • 在windows中访问查看

    在这里插入图片描述

    • 配置匿名共享
    //安装samba服务
    略
    
    //修改etc/samba/smb.conf配置文件,在全局配置中添加以下内容
    [root@server ~]# vim /etc/samba/smb.conf
    
    [global]
            workgroup = SAMBA
            security = user
            map to guest = Bad User            #添加这一行参数
            
            
    //创建共享目录
    [root@server ~]# mkdir /opt/vbark
    [root@server ~]# chmod 777 /opt/vbark/
    
    //配置共享
    [root@server ~]# vim /etc/samba/smb.conf
    [share]
            path = /opt/vbark
            browseable = Yes
            guest ok = Yes
            writable = Yes
            public = Yes
    
    //重启samba服务
    略
    
    //在客户端上查看共享资源
    [root@client ~]# smbclient -L 192.168.86.129 -U 'Bad User'
    Enter SAMBA\Bad User's password:                    #这里不需要输入密码,直接回车即可
    
    	Sharename       Type      Comment
    	---------       ----      -------
    	share           Disk      
    	IPC$            IPC       IPC Service (Samba 4.11.2)
    	
    
    //挂载共享资源
    [root@client ~]# mount -t cifs //192.168.86.129/myshare /mnt -o username='Bad User'
    [root@client mnt]# df -h|grep mnt
    //192.168.86.129/myshare   36G  2.3G   33G   7% /mnt
    
    
    //从客户机上进入共享目录创建新文件
    [root@client ~]# cd /mnt/
    [root@client mnt]# touch 126
    [root@client mnt]# ll
    total 0
    -rwxr-xr-x 1 root root 0 Oct 13 20:37 126
    
    //在服务器上查看
    [root@server vbark]# ll
    total 0
    -rwxr--r-- 1 nobody nobody 0 Oct 13 20:37 126
    
    • 在window上查看

    在这里插入图片描述

    展开全文
  •   ubuntu安装samba   1 自动安装 samba  #sudo apt-get install samba  #sudo apt-get install smbclient  #sudo apt-get insta
  • SAMBA

    2018-02-24 10:43:00
    ...0、架设Samba 服务器的前提; Linux是一个多用户的操作系统,对任何服务器的架设与都用户、用户组及权限相关,这是操作的基础。Samba服务器也不例外,对这些知识的掌握也是极为重要的。在W...
  • 本文主要通过配置samba,达到共享linux文件夹到windows下无密码访问的目的: 首先要做的是要在linux和samba下创建同名账户,这样才能达到共享的目的: ... useradd -m share ...3、创建samba用户sh
  • 1、使用下列命令安装samba sudo apt-get install samba sudo apt-get install smbfs 注明:我使用如下命令安装 我们需要做的第一件事是安装Samba,你可以在Ubuntu软件中心搜索软件,然后安装。如果你想...
  • 1、写一个shell脚本,能够实现一键安装并配置samba服务,执行该脚本时需要带一个路径(格式$0 $1) /opt/samba.sh /opt/samba 2、目录若存在,则自动创建,任何人都可以访问,并且不需要密码,并且是只读的 二、实验...
  • 0. linux 访问window共享的方法: sudo mount -t cifs -o username=yourwindowname,password=yournwindowpassword //10.0.6.92/window-shared-...1. ubuntu 下访问ubuntu的samba共享服务,通过命令,可以将samba服务上
  • 搭建Samba

    2021-06-25 15:56:02
    /bin/sh sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config setenforce 0 yum install samba -y service smb start echo "admin " | useradd -s /sbin/nologin admin echo "admin " | ...
  • ubuntu14.04中利用samba访问linux/windows共享目录的方法 时间:2015-02-04 00:07来源:网络整理 作者:赵红霞 点击: 209 次 ubuntu14.04中访问windows共享目录的方法(1)所需安装的包 sudo apt-get install ...
  • 一、安装samba服务器 $ apt-get install samba $ apt-get install smbclient # 客户端 二、创建samba配置文件和待共享的目录 1. 配置文件备份 $ cp /etc/samba/smb.conf /etc/samba/smb.conf.bak 2. 创建...
  • 一、samba服务器加入AD域。 1,修改主机名: vi /etc/hostname centos #主机名 2,添加以下文件到hosts文件 vi /etc/hosts 192.168.150.2 centos.com #域账号和域ip 3,修改dns vi /etc/resolv.conf search centos...
  • 最近学习linux 其中有个samba服务可以解决windows和linux互访,界面相当于访问windows之间共享访问。界面亲切。故学习学习。。 先下载samba服务器的rpm 包括三个文件。 查看自己系统是否已安装samba rmp -q ...
  • 搭建samba环境并使用户可以通过访问网页修改密码 目录 搭建samba环境并使用户可以通过访问网页修改密码 参考网址: 实验环境: 实现效果: 软件包、配置文件、脚本及素材: 搭建步骤: Samba服务安装: ...
  • 移植samba

    2015-03-17 16:41:56
    交叉编译samba ./configure --prefix=/usr/local/samba --build=i686 --host=arm-none-linux-gnueabi 修改makefile文件的编译器相关的宏定义,CC,AR,RANLIB之类。 make make install 添加samba用户,...
  • 最近学习linux 其中有个samba服务可以解决windows和linux互访,界面相当于访问windows之间共享访问。 先下载samba服务器的rpm 包括三个文件。 查看自己系统是否已安装samba rmp -q samba 系统是否已经安装了...
  • 1、写一个shell脚本,能够实现一键安装并配置samba服务,执行该脚本时需要带一个路径(格式$0 $1) /opt/samba.sh /opt/samba 2、目录若存在,则自动创建,任何人都可以访问,并且不需要密码,并且是只读的 二、实验...
  • samba详解

    千次阅读 2015-09-16 20:09:08
    windows主机之间通过“网上邻居”来访问共享资源,Linux主机之间通过NFS实现资源访问。 windows主机与Linux主机之间可通过SAMBA服务软件实现资源共享。 samba是在不同系统间实现SMB通信协议的一个免费软件,...
  • Samba服务器

    2018-05-07 12:01:30
    问:如何在linux下访问windows共享文件夹Samba服务器可用于windows和Linux之间,局域网内。一,Samba使用的daemonsnmbd 用来管理工作组、NetBIOS name 等等的解析。主要利用UDP 协议开启port 137, 138 来负责名称...
  • 安装samba

    2011-08-14 00:27:17
    2.配置root用户访问所有文件 可以导入系统账户信息到samba: cat /etc/passwd | mksmbpasswd.sh > /etc/samba/smbpasswd 也可以把root账号导入,并设置密码为空: smbpasswd -a root 两个回车。然后修改/etc/s...
  • 最近学习linux 其中有个samba服务可以解决windows和linux互访,界面相当于访问windows之间共享访问。界面亲切。故学习学习。。 先下载samba服务器的rpm 包括三个文件。 查看自己系统是否已安装samba rmp -q ...
  • samba使用

    2018-03-28 08:28:00
    1. 安装:apt-get install samba samba-common smbclient 安装成功后,会默认启动samba服务, 可用ps-ef | grep smb查看 2. 配置文件为/etc/samba/smb.conf 二. 服务器里部署方式 1. 创建目录 创建了3个部门...
  • SAMBA服务

    千次阅读 2014-09-09 12:40:03
    Samba是在Linux和UNIX系统上实现SMB协议的一个免费软件,由服务器及客户端程序构成。 早期在客户端和服务器端传输文件使用FTP,但是

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 6,556
精华内容 2,622
关键字:

sambash访问