There are two ways to access Windows shares in Linux:
Method One: Mount Mount
Create a mount point:
[Email protected] mnt]# Mkdir/mnt/myshare
Mount:
[Email protected] mnt]# mount-t cifs-o Username=lee//192.168.8.1/share/mnt/myshare/
The specific meaning of several parameters:
Cifs:common Internet File System, #可以理解为网络文件系统. Usrname: #访问共享文件夹的用户名password: #访问密码 (I do not have a clear input here)//192.168.66.198/share: #表示网络文件夹的地址, note that there is no last addition/// 192.168.66.198/share/will report the following error: Mount://192.168.66.198/share/is not a valid block device
Automatic mount on Boot:
[Email protected] mnt]# vim/etc/fstab//192.168.8.1/share/mnt/myshare cifs defaults,username=lee,password=******* 0 2[[email protected] mnt]# mount-a
Method Two: Samba-client
Check to see if there are any sambaclient installed
[Email protected] myshare]# Rpm-qa | grep Samba
If not, install the Samba client:
[email protected] myshare]# Yum install samba-client
To view Windows shared folders:
[Email protected] myshare]# smbclient-u lee-l//192.168.8.1
To manipulate Windows shared folders:
[Email protected] myshare]# smbclient-u Lee//192.168.8.1/shareenter Lee ' s Password:domain=[dannylee] os=[windows En Terprise 10240] server=[windows Enterprise 6.3]smb: \> #表示进入sambaclient的内部命令: SMB: \> help #查看smb可用命令smb: \> h ELP get #查看具体命令使用方法HELP get:<remote name> [local name] Get a FILESMB: \>ls #查看共享文件夹中的文件
To download a file from a shared folder:
SMB: \> Get 3389.txt/lee/bak/test.txt
Upload a file to a shared folder:
SMB: \> put/lee/bak/test.txt test.txt
Other commands are slightly.
NOTES: Linux access to Windows sharing