![](https://static.wixstatic.com/media/68165d_9e20b294468340ca880882e1256dd4b4~mv2.jpg/v1/fill/w_564,h_353,al_c,q_80,enc_auto/68165d_9e20b294468340ca880882e1256dd4b4~mv2.jpg)
IP máy windows share: 192.168.1.100
Thư mục share: windows_share
User được gán quyền trên thư mục share: windows_user
Password của user được gán quyền share: 1234@123
Cài CIFS
$ sudo apt-get update
$ sudo apt-get install cifs-utils
Tạo thư mục để mount
$ sudo mkdir /data/backup
Kiểm tra mount trực tiếp
$ sudo mount -t cifs -o username=windows_user, password=1234@123 //192.168.1.100/windows_share /data/backup
Nếu mount thành công ta thực hiện bước tiếp theo
Tạo cifs-credential file
$ sudo nano /etc/cifs-credentital
Nội dung file cifs-credentital
user=windows_user
pass=1234@123
Cấu hình tự động mount trong file fstab
$ sudo nano /etc/fstab
Nội dung file fstab
//192.168.1.100/windows_share /data/backup cifs credentials=/etc/cifs-credential,file_mode=0755,dir_mode=0755 0 0
Có thể kiểm tra bằng lệnh
$ df -Th
Comments