2015-10-16

[SOLVED]samba-on-ubuntu

#15:37 07/10/2015
#apt-get install samba smbclient
#cat /etc/samba/smb.conf
############################################################SAMBA CONFIG:BEGIN
######SMB CONFIG START HERE#####
[global]
workgroup = WORKGROUP
interfaces = lo eth1 x.x.1.0/24
hosts allow = 127. x.x.1.2 x.x.1.3
server string = Samba Server %v
netbios name = ubuntu
security = user
map to guest = bad user
dns proxy = no
client xxx auth = yes
printing = bsd
printcap name = /dev/null
################################
#______SHARE DEFINITIONS-FULL PERMISSION
[Anonymous]
path = /samba/anonymous
browsable =yes
writable = yes
guest ok = yes
read only = no
comment = THIS IS ANONYMOUS SHARE, FULL PERMISSION
#______SECURED SHARE-FULL PERMISSION
[secured]
path = /samba/secured
valid users = xxx,@smbgrp
browsable = yes
writable = yes
guest ok = no
valid users = xxx
comment = THIS IS SECURED SHARE, FULL PERMISSION
#______SECURED SHARE-READONLY
[ALIAS_NAME]
path = <path>
valid users = xxx,xxx,@smbgrp
guest ok = yes
writable = no
browsable = yes
comment = THIS IS SECURED SHARE, READONLY
################################
############################################################SAMBA CONFIG:END
/etc/init.d/smbd restart
/etc/init.d/nmbd restart


root@srv:xxx# ll
total 12
drwxr-xr-x 3 root  root  4096 Jul 10 10:47 ./
drwxr-xr-x 9 root  root  4096 Oct  6 09:23 ../
drwxrwxr-x 7 music music 4096 Oct  7 10:25 files/


#/etc/passwd
music:x:1001:1001:music,,,:/home/music:/bin/bash

#/etc/group
music:x:1001:


root@srv:xxx# smbpasswd -a music
New SMB password:        xxx
Retype new SMB password: xxx
Added user music.


/etc/init.d/smbd restart
/etc/init.d/nmbd restart


#Test status:
smbclient -L //<IP> -U music
smbclient -L //localhost -U music


root@srv:xxx# smbclient -L //<IP> -U music
Unknown parameter encountered: "client xxx auth"
Ignoring unknown parameter "client xxx"
Enter music's' password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 4.1.6-Ubuntu]

        Sharename       Type      Comment
        ---------       ----      -------
        music_file      Disk      THIS IS SECURED SHARE, READONLY
        secured         Disk      THIS IS SECURED SHARE, FULL PERMISSION
        Anonymous       Disk      THIS IS ANONYMOUS SHARE, FULL PERMISSION
        IPC$            IPC       IPC Service (Samba Server 4.1.6-Ubuntu)
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 4.1.6-Ubuntu]

        Server               Comment
        ---------            -------
        SRV145               srv145 server (Samba, Ubuntu)

        Workgroup            Master
        ---------            -------
        WORKGROUP            SRV145
root@srv:xxx#


/etc/init.d/smbd restart
/etc/init.d/nmbd restart

Xem trang thái các connection: smbstatus

No comments:

Post a Comment