samba

Win32: API calls to list available network shares on a server?

青春壹個敷衍的年華 提交于 2019-12-06 06:17:37
Assume I have access to a SMB server at IP 1.2.3.4, how can I determine the list of available shares? Windows Explorer can do it when I enter a UNC path \\1.2.3.4\ - but command prompt "dir \\1.2.3.4\" fails! I've tried the usual FindFirstFile/FindNext calls - which I use successfully to read the files and directories on each share, but they don't work directly on the server root. Ideally, I need something that works for XP onwards. Edit: I want to do this programatically, rather than from command line. Redirecting and parsing the output from 'net view 1.2.3.4' would work, but I'm ideally

centos 7 搭建Samba

我只是一个虾纸丫 提交于 2019-12-06 05:47:19
一、Samba简介 Samba是一个能让Linux系统应用Microsoft网络通讯协议的软件,由客户端和服务端构成。 SMB(Server Message Block的缩写,即服务器消息块)主要是作为Microsoft的网络通讯协议,后来Samba将SMB通信协议应用到了Linux系统上,就形成了现在的Samba软件。后来微软又把 SMB 改名为 CIFS(Common Internet File System),即公共 Internet 文件系统,并且加入了许多新的功能,这样一来,使得Samba具有了更强大的功能。   Samba最大的功能就是可以用于Linux与windows系统直接的文件共享和打印共享,Samba既可以用于windows与Linux之间的文件共享,也可以用于Linux与Linux之间的资源共享,由于NFS(网络文件系统)可以很好的完成Linux与Linux之间的数据共享,因而 Samba较多的用在了Linux与windows之间的数据共享。   SMB是基于客户机/服务器型的协议,因而一台Samba服务器既可以充当文件共享服务器,也可以充当一个Samba的客户端,例如,一台在Linux 下已经架设好的Samba服务器,windows客户端就可以通过SMB协议访问Samba服务器上的资源,同时,Samba服务器也可以访问网络中

samba-swat centos7配置

℡╲_俬逩灬. 提交于 2019-12-06 02:28:14
samba-swat centos7配置 ########################################################时间同步 yum install -y ntpdate crontabs service crond start chkconfig crond on \cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime ntpdate ntp6.aliyun.com #ntp6.aliyun.com echo "*/3 * * * * /usr/sbin/ntpdate ntp6.aliyun.com &> /dev/null" > /tmp/crontab crontab /tmp/crontab ######################################################## ########################################################samba ##安装配置 samba yum install -y krb5-libs krb5-deve krb5-workstation pam_krb5 yum install -y samba samba-client samba-winbind-clients

Accessing samba shares with gio in python

混江龙づ霸主 提交于 2019-12-06 02:28:01
问题 I am trying to make a simple command line client for accessing shares via the Python bindings of gio (yes, the main requirement is to use gio). I can see that comparing with it's predecessor gnome-vfs, it provides some means to do authentication stuff (subclassing MountOperation ), and even some methods which are quite specific to samba shares, like set_domain() . But I'm stuck with this code: import gio fh = gio.File("smb://server_name/") If that server needs authentication, I suppose that a

linux samba客户端

我们两清 提交于 2019-12-05 23:58:35
Samba不仅仅可以用于Linux与Windows之间的文件共享,也可以用于在Linux与Linux之间进行文件的共享,是一个功能十分强的工具,可以将共享文件夹直接挂载,就像是访问u盘一样来访问共享文件夹,十分便捷。 首先需要安装cifs-utils: sudo apt-get install cifs-utils 然后新建一个文件夹来进行挂载(也可以在别的文件夹,/mnt通常作为挂载点) mkdir /mnt/share 服务器共享的目录全称//192.168.1.5/pi(或者//SAMBA/pi) 用户名:pi 密码:12345678 然后就可以将共享文件夹挂载在/mnt/share下 !注意事先不要cd 到/mnt/share mount.cifs //192.168.1.6/pi /mnt/share -o username=pi mount.cifs //192.168.1.23/sh /share 然后输入密码后回车 然后现在可以看到已经挂载成功 [root @localhost ~]# cd /mnt/share/ [root @localhost share]# ls Desktop Downloads Music opencv Public STUDY Videos Documents GYY oldconffiles Pictures python_games

Accessing Samba Share with authentication, No Drive Mapping - C# [duplicate]

老子叫甜甜 提交于 2019-12-05 23:07:43
This question already has answers here : Accessing a Shared File (UNC) From a Remote, Non-Trusted Domain With Credentials (10 answers) Closed 3 months ago . I'm trying to start a connection to a samba share that requires authentication. I do not want the drive to be mapped. The credentials will always be the same for the share. Once it authenticates I can just use a regular path to work with it. I'm using C#.net Any ideas ? I googled some stuff and read up on Impersonation, but I dont think it meets my needs. Thanks in Advance! rreeves I was able to get it working with the following Q&A from

samba

大兔子大兔子 提交于 2019-12-05 19:19:24
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。 本文链接: https://blog.csdn.net/andylauren/article/details/78955476 1、sudo apt-get install samba 如果遇到问题: Depends: samba-common (= 2:3.6.3-2ubuntu2) but 2:3.6.25-0ubuntu0.12.04.2 is…… 解决: sudo apt-get remove samba-common sudo apt-get remove libwbclient0 2、sudo apt-get install samba-client 3、sudo vi /etc/samba/smb.conf 找到security这行并将#注释符号去掉改成 security = share #共享模式 添加如下代码: [share] comment = share path = /home/linux/share #设置共享文件夹目录 workgroup = linux #Windows上创建linux上的用户组 browseable = yes guest ok = yes writable = yes public = yes valid users =

Debian 9 Samba共享的一个问题总结

空扰寡人 提交于 2019-12-05 18:53:55
因为工作环境稳定性的需求,我逐步转移到Debian下工作,虽然Ubuntu更新比较快,但是并不是都是好事!特别是滚动升级这一点上,稳定性比较差,这一点不如Debian! 言归正传,上个星期我更换安装系统Debian,安装配置Samba之后,按照原来Ubuntu的配置修改,可是win7系统无法使用sampasswd配置的用户登陆系统,经过一个惨痛的经历(原挂载的硬盘数据因为手误rm -rf了-_-!!),在今日,我研究一个无聊的问题时,居然连同这个问题一同解决了,这也是我为什么写上一遍blog的原因《 网络安全:LAN管理器身份验证级别,恢复默认的“没有定义” 》 测试的win7(我的笔记本),我在组策略上,将“LAN管理器身份验证级别”配置为“发送LM和NTLM - 如果已协商,则使用NTLMv2会话安全”,这一个原来在Ubuntu16上是完全没问题的,可是Debian9上,就无法通过(设置的用户,非guest,guest用户可以登录),我一直认为是权限问题,就在这时,意外发生了,我配置权限以及更改挂载点时,不小心使用了rm -rf,当反应过来是已经晚了! 就在今日我研究那个LAN的时候,测试时使用账号登陆,我才意识到是协议问题!估计是Ubuntu能够识别和处理这类协议,而Debian不能的原因! 特此记录,待续还会继续测试研究具体原因,待续········ 来源: oschina

服务端口号

非 Y 不嫁゛ 提交于 2019-12-05 17:18:01
常见服务或协议与对应端口号 : ftp数据端口           20(数据端口) 21(控制端口) ssh(全shell使用)         22 telnet 服务         23 DNS域名解析服务      53,953 http(web端)安全超文本传输协议      80 https         443 tomcat         8080访问web的端口,8005 t omcat本身自己的端口,8009 与http等服务器建立连接的端口 ntp         123 nfs         2049 Redhat企业被Samba使用的netbios名称服务 137/tcp Redhat企业被Samba使用的netbios数据服务  138/tcp Redhat企业被Samba使用的netbios会话服务 139/tcp rsyslog         514 tcp/udp pop3 邮局协议版本      110/tcp pop3s         995/tcp postfix         25 smtp简单邮件传输协议      25/tcp smtps            465/tcp imap互联网消息村相互协议         143/tcp imaps         993/tcp dhcp (引导协议服务)    

Force a Samba process to close a file

柔情痞子 提交于 2019-12-05 16:40:41
Is there a way to force a Samba process to close a given file without killing it? Samba opens a process for each client connection, and sometimes I see it holds open files far longer than needed. Usually i just kill the process, and the (windows) client will reopen it the next time it access the share; but sometimes it's actively reading other file for a long time, and i'd like to just 'kill' one file, and not the whole connection. edit: I've tried the 'net rpc file close ', but doesn't seem to work. Anybody knows why? edit: this is the best mention i've found of something similar. It seems to