samba

Linux-安装-Samba

懵懂的女人 提交于 2019-12-12 05:17:25
time 20191128 author venki 安装前准备 系统平台:centos7.5 cat /etc/redhat-release Samba 版本信息 # 查看是否安装Samba | 没有则安装 whereis Samba # 安装Samba yum -y install samba # 查询是否安装成功 rpm -qa | grep samba # 多出来的是因为依赖关系装上去的 samba-client-libs-4.9.1-6.el7.x86_64 samba-common-tools-4.9.1-6.el7.x86_64 samba-common-4.9.1-6.el7.noarch samba-common-libs-4.9.1-6.el7.x86_64 samba-libs-4.9.1-6.el7.x86_64 samba-4.9.1-6.el7.x86_64 Samba server:192.168.32.128 关闭防火墙 # 查看防火墙状态 firewall-cmd --state # 关闭防火墙 systemctl disable firewalld.service systemctl stop firewalld 关闭Selinux vi /etc/selinux/config SELINUX=enforcing改为SELINUX

Symbolic links on Samba share

ⅰ亾dé卋堺 提交于 2019-12-12 00:13:14
问题 I have a Samba share. Is there any way to determine from Windows side if a specific folder is a symlink or standard directory? 回答1: According to the MS documentation this was not taken into account in the protocol specification. On that page you can see that there is no specification for the (symbolic) links. I also tested with smbclient under Linux (Ubuntu) and there is no difference between links and directory. 来源: https://stackoverflow.com/questions/11821256/symbolic-links-on-samba-share

Copying file from a Samba drive to an Android sdcard directory

﹥>﹥吖頭↗ 提交于 2019-12-11 11:44:19
问题 I am new to Android and Samba. I am trying to use the JCIFS copy. To method to copy a file from a Samba directory to the 'Download' directory under sdcard on an Android 3.1 device. Following is my code: from = new SmbFile("smb://username:password@a.b.c.d/sandbox/sambatosdcard.txt"); File root = Environment.getExternalStorageDirectory(); File sourceFile = new File(root + "/Download", "SambaCopy.txt"); to = new SmbFile(sourceFile.getAbsolutePath()); from.copyTo(to); I am getting a

Using celery in a django app to run script with root priviliges?

穿精又带淫゛_ 提交于 2019-12-11 10:43:51
问题 I need to run some commands on my ubuntu box where my django project resides that requires root privileges, from within my django project. I'm using celery to fire off an asynch process, this process in turn calls shell commands that requires root privileges to succeed. How can I do this without risking creating huge security holes? PS! The shell commands I need to call are smbpasswd, edit /etc/samba/smb.conf and restart the samba service. 来源: https://stackoverflow.com/questions/3767841/using

transparent access to files on Samba shares on Linux et al. using C++ IO streams

狂风中的少年 提交于 2019-12-11 05:23:40
问题 Is it possible to open files on Samba shares using C++ IO streams in Linux as transparently as on Windows using just UNC path (or similar) or do I always need some kind of 3rd party library? If a 3rd party library is the only solution, what 3rd party libraries are there for Samba shares access? 回答1: It looks like you just want to mount the remote server using cifsfs (see "man mount.cifs"), and then access the files from the mount point you specified. There is no way that you can explicitly

(CVE-2017-7494)Samba远程代码执行[Linux]

爱⌒轻易说出口 提交于 2019-12-10 22:44:58
简介 此漏洞是针对开启了共享的smb服务 漏洞利用 启动msfconsole search is_known_pipename   搜索此模块 use exploit/linux/samba/is_known_pipename 调用此模块 配置目标靶机IP地址,配置目标靶机文件共享名 rexploit   运行 查看靶机信息 id  whoam cat /proc/version 拿到目标后可以进行提权了 解决漏洞方案 在靶机上编辑Samba服务配置文件smb.config vim /etc/samba/smb.conf 在第76行添加 nt pipe support = no service smb restart 重启smb服务,然后回到渗透机上,重新使用溢出模块对靶机的smb服务进行溢出操作,使用命令rexploit 此时发现利用脚本给出的操作提示: ] 172.16.1.29:445-No suitable share and path were found, try setting SMB_SHARE_NAME and SMB_FOLDER //没有找到合适的共享和路径,尝试设置Smb_Share_Name和SMB_FOLDER 由于我们关闭了pipe support会禁用 Windows 客户端的共享列表。所以此处漏洞无法成功进行利用 来源: https://www

Mint17/Ubuntu14.04 samba文件服务器搭建

末鹿安然 提交于 2019-12-10 14:51:49
一、简介 Samba是在Linux和UNIX系统上实现SMB协议的一个免费软件,由服务器及客户端程序构成。 SMB 是一种在 局域网 上共享文件和打印机的一种 通信协议 ,它为局域网内的不同计算机之间提供文件及打印机等资源的共享服务。SMB协议是客户机/服务器型协议,客户机通过该协议可以访问服务器上的共享文件系统、打印机及其他资源。通过设置“NetBIOS over TCP/IP”使得Samba不但能与局域网络主机分享资源,还能与全世界的电脑分享资源。 二、搭建步骤 1、使用包管理器 安装S amba 服务器 sudo apt-get install samba 2、 备份 samba 配置文件,避免错误配置,便于及时回退之前的状态 sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak 3.创建共享目录 注释:/home/share可以指定为一个合法的路径即可 sudo mkdir -p /home/share 4. 修改配置文件 sudo vim /etc/samba/smb.conf 5、例如此时为所有的用户创建一个共享目录,此时 在配置文件 smb.conf 最后添加如下: [共享] Commnet = “xxxxxx” 注释:该共享目录的描述 Path = “/home/share” 注释:设置共享目录为/home

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

一世执手 提交于 2019-12-10 10:38:59
问题 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

Centos7 samba配置

社会主义新天地 提交于 2019-12-09 12:21:13
Samba配置了很多次,总是忘,现在写在博客里。 最主要的是免密配置,主要用到了两个配置,要写在[global]里: map to guest = Bad User guest ok = yes 结果安装完了之后,文件夹被识别成了打印机,那是因为错配了一个参数。 就是在配置public的时候复制时多了一个printable = Yes printable = Yes 所有配置: # See smb.conf.example for a more detailed config file or # read the smb.conf manpage. # Run 'testparm' to verify the config is correct after # you modified it. [global] workgroup = SAMBA security = user passdb backend = tdbsam printing = cups printcap name = cups load printers = yes cups options = raw map to guest = Bad User guest ok = yes [homes] comment = Home Directories valid users = %S, %D%w%S