Use samba to mount the directory shared by the Windows file sharing service under Linux

1 The Linux operating system I use is RHEL5 (CentOS)

 

 

2 Installed rpm package:

samba-client

samba-common

 

 

3 After installing the above two rpm packages, you can use the smbclient command to check:

[root@huzw ~]# smbclient //172.16.1.5/DevTest/ -U huzw                 
Password:
Domain=[STREAM] OS=[Windows Server 2003 3790 Service Pack 1] Server=[Windows Server 2003 5.2]
smb: /> ls
  .                                   D        0  Mon Feb 21 16:07:12 2011
  ..                                  D        0  Mon Feb 21 16:07:12 2011

 

The above results indicate that the installation was successful

 

 

4 Create a mount point

  mkdir /mnt/15devtest

 

 

5 Write the following mount command to /etc/rc.local

  mount -t cifs -o codepage=cp936,username=huzw,password=密码 -l //172.16.1.5/DevTest/ /mnt/15devtest/

  You can try this command in the shell first. If there are special characters in the username and password, you need to add a backslash/escaping.

  Note: Some documents say mount -t smbfs, but kenel above Linux E 5 no longer supports smbfs, use mount -t cifs

Guess you like

Origin blog.csdn.net/huzhenwei/article/details/6250843