{"id":4036,"date":"2019-07-18T18:48:03","date_gmt":"2019-07-18T10:48:03","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=4036"},"modified":"2019-07-20T23:39:03","modified_gmt":"2019-07-20T15:39:03","slug":"smbclient","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/smbclient","title":{"rendered":"smbclient\u547d\u4ee4 – \u5b58\u53d6SMB\/CIFS\u670d\u52a1\u5668\u7684\u7528\u6237\u7aef\u7a0b\u5e8f"},"content":{"rendered":"\n

SMB\u4e0eCIFS\u4e3a\u670d\u52a1\u5668\u901a\u4fe1\u534f\u8bae\uff0c\u5e38\u7528\u4e8eWindows95\/98\/NT\u7b49\u7cfb\u7edf\u3002smbclient(samba client)\u53ef\u8ba9Linux\u7cfb\u7edf\u5b58\u53d6Windows\u7cfb\u7edf\u6240\u5206\u4eab\u7684\u8d44\u6e90\u3002<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f<\/strong>\uff1asmbclient [\u53c2\u6570] <\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570<\/strong>\uff1a <\/p>\n\n\n\n
-L <\/td>\u663e\u793a\u670d\u52a1\u5668\u7aef\u6240\u5206\u4eab\u51fa\u6765\u7684\u6240\u6709\u8d44\u6e90 <\/td><\/tr>
-U <\/td>\u6307\u5b9a\u7528\u6237\u540d\u79f0 <\/td><\/tr>
-s<\/td>\u6307\u5b9asmb.conf\u6240\u5728\u7684\u76ee\u5f55 <\/td><\/tr>
-O<\/td>\u8bbe\u7f6e\u7528\u6237\u7aefTCP\u8fde\u63a5\u69fd\u7684\u9009\u9879 <\/td><\/tr>
-N<\/td>\u4e0d\u7528\u8be2\u95ee\u5bc6\u7801 <\/td><\/tr><\/tbody><\/table>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n

\u5217\u51fa\u67d0\u4e2aIP\u5730\u5740\u6240\u63d0\u4f9b\u7684\u5171\u4eab\u6587\u4ef6\u5939\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# smbclient -L 198.168.0.1 -U username%password<\/pre>\n\n\n\n

\u50cfftp\u5ba2\u6237\u7aef\u4e00\u6837\u4f7f\u7528smbclient \uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# smbclient \/\/192.168.0.1\/tmp  -U username%password <\/pre>\n\n\n\n

\u6267\u884csmbclient\u547d\u4ee4\u6210\u529f\u540e\uff0c\u8fdb\u5165smbclient\u73af\u5883\uff0c\u51fa\u73b0\u63d0\u793a\u7b26\uff1asmb:\/><\/p>\n\n\n\n

\u8fd9\u91cc\u6709\u8bb8\u591a\u547d\u4ee4\u548cftp\u547d\u4ee4\u76f8\u4f3c\uff0c\u5982cd \u3001lcd\u3001get\u3001megt\u3001put\u3001mput\u7b49\u3002\u901a\u8fc7\u8fd9\u4e9b\u547d\u4ee4\uff0c\u6211\u4eec\u53ef\u4ee5\u8bbf\u95ee\u8fdc\u7a0b\u4e3b\u673a\u7684\u5171\u4eab\u8d44\u6e90\u3002<\/p>\n\n\n\n

\u76f4\u63a5\u4e00\u6b21\u6027\u4f7f\u7528smbclient\u547d\u4ee4\uff1a <\/p>\n\n\n\n

[root@linuxcool ~]# smbclient -c \"ls\"  \/\/192.168.0.1\/tmp  -U username%password <\/pre>\n\n\n\n

\u6216\u8005\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# smbclient \/\/192.168.0.1\/tmp  -U username%password smb:\/>ls <\/pre>\n\n\n\n

\u521b\u5efa\u4e00\u4e2a\u5171\u4eab\u6587\u4ef6\u5939\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# smbclient -c \"mkdir share1\" \/\/192.168.0.1\/tmp -U username%password <\/pre>\n","protected":false},"excerpt":{"rendered":"

SMB\u4e0eCIFS\u4e3a\u670d\u52a1\u5668\u901a\u4fe1\u534f\u8bae\uff0c\u5e38\u7528\u4e8eWindows95\/98\/NT\u7b49\u7cfb\u7edf\u3002smbclient(samba […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/4036"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=4036"}],"version-history":[{"count":3,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/4036\/revisions"}],"predecessor-version":[{"id":4058,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/4036\/revisions\/4058"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=4036"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=4036"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=4036"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}