1. 程式人生 > >samba安裝與配置

samba安裝與配置

linux samba

samba

yum install -y samba samba-client (安裝Samba的客戶端和服務)

mkdir /tmp/sambadir (創建Samba的共享目錄)

vim /etc/samba/smb.conf (修改Samba配置文件)

workgroup = WORKGROUP

security = share

[workspace]

comment = share all

path = /tmp/sambadir

browseable = yes

public = yes

writeable = no

/etc/init.d/smb start (啟動Samba服務)

smbclient //192.168.111.129/workspace (linux上連接Samba服務命令)

yum install -y cifs-utils (安裝Samba掛載包)

mount -t cifs //192.168.111.129/workspace /opt/ (將Samba目錄掛載到opt文件夾下)

創建有用戶名及密碼的Samba

vim /etc/samba/smb.conf (編輯配置文件)

security = user

[sharespace]

comment = share for users

path = /tmp/sambadir

public = yes

writeable = no

useradd smbuser1 (添加系統用戶)

pdbedit -a smbuser1 (添加Samba用戶)

/etc/init.d/smb restart (重啟服務)

smbclient -Usmbuser1 //192.168.111.129/sharespace (登陸Samba)

mount -t cifs -o username=smbuser1,password=evildragonfly23 //192.168.111.129/sharespace (使用掛載的方法來掛載Samba目錄到本機,並往相關文件夾內上傳文件)


samba安裝與配置