1. 程式人生 > >阿里雲搭建samba伺服器

阿里雲搭建samba伺服器

118.190.215.49
sudo yum install samba
sudo vi /etc/samba/smb.conf

[share]
   comment = Share
   path = /home/sam/share
   available = yes
   browseable = yes
   public = no
   writable = yes

11

[[email protected] etc]$ sudo vi /etc/samba/smb.conf
[[email protected] etc]$ sudo smbpasswd -a jack
New SMB password:
Retype new SMB password:
Added user jack.

在這裡插入圖片描述

輸入"sudo service smbd restart"重啟samba服務
在這裡插入圖片描述

二、samba安裝&配置
1、安裝
rpm -qa | grep samba
yum install samba
chkconfig smb on

2、配置
cp /etc/samba/smb.conf /etc/samba/smb.confbak
vi /etc/samba/smb.conf
[global]
diplay charset = gbk
unix charset = gbk
dos charset = gbk
workgroup = work
netbios name = work
server string = uc
security = user

[darwin]
comment = uc
path=/home/work/
create mask = 0664
directory mask = 0775
writeable = yes
valid users = work
browseable = yes

#新增使用者
smbpasswd -a work

3、啟動

smbd -D
#檢視程序是否啟動
ps auxf | grep smbd
netstat –npl 檢視samba埠號,預設會使用139、445兩個埠號

4、本地測試
smbclient -L 127.0.0.1 -U work

mac:
command +k ; smb://ip_address

windows:
執行輸入:\Samba伺服器的ip

【參考】
http://www.cnblogs.com/suihui/p/4334224.html
http://www.cnblogs.com/kreo/p/4368811.html

https://blog.csdn.net/coder_ai/article/details/51531521