在Linux下用smbclient命令访问Windows共享……

功能说明:
在Windows操作系统之间,可以通过网上邻居或UNC路径的方式,访问某个共享,在Linux下,可以通过smbclient命令来实现相似的功能,访问Windows的某个共享目录。
测试平台:
Red Hat Enterprise Linux AS release 3 (Taroon)
Windows 2000 Advanced Server SP4
 
当前测试条件:
1、 Windows和Linux共处于同一个局域网中,可以互相ping通,都未设置防火墙
2、 Windows的IP地址:192.168.60.188
3、 Linux的IP地址:192.168.60.189
4、 Windows上当前有如下共享:c$,temp(everyone具有读取权限)
5、 Windows上的用户有cmw(管理员组用户帐号),grp(管理员组用户帐号),guest(当前未启用),没有root帐号
6、Linux上安装有相关的RPM包:samba-client,它是Samba客户端工具
 
基本测试过程如下:
1、 访问c$共享:
[root@rh root]# smbclient //192.168.60.188/c$ -U cmw
Password:                                          
smb: /> cd winnt                                   
smb: /winnt/>                                       
 
2、 访问temp共享(启用guest帐户)
[root@rh root]# smbclient //192.168.60.188/temp
Password:(未输入任何密码)
smb: />                                       
 
3、 访问temp共享(未启用guest帐户)
[root@rh root]# smbclient //192.168.60.188/temp
Password:(未输入任何密码)
Anonymous login successful                    
tree connect failed: NT_STATUS_ACCESS_DENIED  
[root@rh root]#                               
 
扩展研究:
1、 smbclient命令成功后,可以使用的命令及研究:
 
[root@rh root]# smbclient //192.168.60.188/temp -U cmw                   
Password:                                                                
smb: /> ?                                                                
 
?
altname
archive
blocksize
cancel
cd
chmod
chown
del
dir
du
exit
get
help
history
lcd
link
lowercase
ls
mask
md
mget
mkdir
more
mput
newer
open
print
printmode
prompt
put
pwd
q
queue
quit
rd
recurse
reget
rename
reput
rm
rmdir
setmode
symlink
tar
tarmode
translate
!
 
 
 
以上为可以使用的命令,常用命令如下:
1)        ?命令
smb: /> ? ?                                          
HELP ?:                                              
        [command] give help on a command             
语法:? [command]
功能:可以查看一个命令的使用方法
2)        cd命令
smb: /> ? cd                                          
HELP cd:                                             
        [directory] change/report the remote directory
                                                     
smb: /> cd samba                                     
语法:cd [directory]
功能:改变远程目录
3)        du命令
smb: /samba/> ? du                                                
HELP du:                                                          
        <mask> computes the total size of the current directory   
                                                                   
smb: /samba/> du                                                  
                                                                  
                42293 blocks of size 1048576. 5098 blocks available
Total number of bytes: 16880894                                   
语法:du
功能:统计当前目录下文件总计大小,不包括子目录容量。
4)         
5)         
1、 smbclient命令的其它参数,待续……
      2、其它,待续……
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值