## Install Samba Server ``` sudo apt-get install samba ``` ## Create User and password ``` sudo useradd share # the user name is "share" sudo smbpasswd -a share ``` ## Mount Aliyun OSS to the local folder ``` ossfs xxx data/ -ourl=oss-cn-xxx.aliyuncs.com -o allow_other ``` ## Configure Share Folder append below configuration to **/etc/samba/smb.conf** ``` [share] available = yes browseable = yes path = /home/joybb/share create mask = 0777 directory mask = 0777 valid users = share force user = nobody force group = nogroup public = yes writable = yes available = yes ``` ## Start Samba Service ``` sudo /etc/init.d/smbd restart ``` ## Open the Related ports Samba服务所使用的端口和协议: 1)Port 137 (UDP) - NetBIOS 名字服务 ; nmbd 2)Port 138 (UDP) - NetBIOS 数据报服务 3)Port 139 (TCP) - 文件和打印共享 ; smbd (基于SMB(Server Message Block)协议,主要在局域网中使用,文件共享协议) 4)Port 389 (TCP) - 用于 LDAP (Active Directory Mode) 5)Port 445 (TCP) - NetBIOS服务在windos 2000及以后版本使用此端口, (Common Internet File System,CIFS,它是SMB协议扩展到Internet后,实现Internet文件共享) 6)Port 901 (TCP) - 用于 SWAT,用于网页管理Samba