Ubuntu 配置 samba 實現資料夾共享

LiuYinChina發表於2013-10-20
#直接 copy 到 命令列執行
mkdir /home/$(whoami)/share; sudo sh -c "echo \"\ncd share\n\" >> /home/$(whoami)/.bashrc"; sudo chmod a+rwx /home/$(whoami)/share; sudo apt-get install samba; sudo smbpasswd -a $(whoami);

#無密碼
sudo sh -c "echo \"\n[share]\npath = /home/$(whoami)/share\npublic = yes\nwritable = yes\n\" >> /etc/samba/smb.conf"

#有密碼
sudo sh -c "echo \"\n[share]\npath = /home/$(whoami)/share\npublic = yes\nwritable = yes\nvalid users = $(whoami)\ncreate mask = 0777\ndirectory mask = 0777\navailable = yes\nbrowseable = yes\n\" >> /etc/samba/smb.conf"

相關文章