smb

Create smb server in order to share files

*爱你&永不变心* 提交于 2019-12-06 11:53:07
问题 Most of the places online explain how to connect and read data hosted by a smb server. Wikipedia explains more about smb at: http://en.wikipedia.org/wiki/Server_Message_Block So what I am trying to do is to be able to open a file (located on the internet) from windows eplorer as: I need to add this functionality to a program that I am creating. If it is to complicated to create such server I guess I will not do it but I want to try my best. I found this link which might help me do what I am

crontab命令

本秂侑毒 提交于 2019-12-06 06:55:26
crontab命令 被用来提交和管理用户的需要周期性执行的任务,与windows下的计划任务类似,当安装完成操作系统后,默认会安装此服务工具,并且会自动启动crond进程,crond进程每分钟会定期检查是否有要执行的任务,如果有要执行的任务,则自动执行该任务。 语法: crontab [ -u user ] file 或 crontab [ -u user ] { -l | -r | -e } 说明: crontab 是用来让使用者在固定时间或固定间隔执行程序之用,换句话说,也就是类似使用者的时程表。 -u user 是指设定指定 user 的时程表,这个前提是你必须要有其权限(比如说是 root)才能够指定他人的时程表。如果不使用 -u user 的话,就是表示设定自己的时程表。 参数: -e : 执行文字编辑器来设定时程表,内定的文字编辑器是 VI,如果你想用别的文字编辑器,则请先设定 VISUAL 环境变数来指定使用那个文字编辑器(比如说 setenv VISUAL joe) -r : 删除目前的时程表 -l : 列出目前的时程表 -u<用户名称>:指定要设定计时器的用户名称。 crontab文件的含义:用户所建立的crontab文件中,每一行都代表一项任务,每行的每个字段代表一项设置,它的格式共分为六个字段,前五段是时间设定段,第六段是要执行的命令段,格式如下:

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

Always permission 777 on mount shared cifs

不羁的心 提交于 2019-12-06 04:36:22
I have a little problem when I mount a SMB shared folder from a Synology NAS. I want to mount a shared folder with permissions: git:root 700 But the mounted folder always have permission set to 777 ( even after a chmod 700 without error) In my /etc/fstab I used this line: #uid=999 ---> git user //server/folder /mnt/artifacts cifs username=windowsUser,password=xxxxx,gid=0,uid=999,file_mode=0700,dir_mode=0700,iocharset=utf8 0 0 Do you know why I cannot set my rights to 700 ? I did a mistake ? Something stupid ? Thanks in advance for your help ;) Your problem is a very common one. You are using

Reading file over network slow due to extra reads

邮差的信 提交于 2019-12-06 00:34:25
问题 I'm reading a file and I either read a row of data (1600 sequential reads of 17 bytes) or a column of data (1600 reads of 17 bytes separated by 1600*17=27,200 bytes). The file is either on a local drive or a remote drive. I do the reads 10 times so I expect in each case to read in 272,000 bytes of data. On the local drive, I see what I expect. On the remote drive when reading sequentially I also see what I expect but when reading a column, I see a ton of extra reads being done. They are 32

Performance: Very slow file copying to Windows network using JCIF

删除回忆录丶 提交于 2019-12-05 16:11:51
I'm trying to copy a file from my local machine to Shared folder in a windows server. This is the function which I used. public static void copyFileUsingJcifs(final String domain, final String userName, final String password, final String sourcePath, final String destinationPath) throws IOException { final NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(domain, userName, password); final SmbFile sFile = new SmbFile(destinationPath, auth); final SmbFileOutputStream smbFileOutputStream = new SmbFileOutputStream(sFile); final FileInputStream fileInputStream = new FileInputStream

linux 文件夹分享

有些话、适合烂在心里 提交于 2019-12-05 14:09:48
1.在 linux 安装 samba,安装好之后 配置文件在 /etc/samba/smb.conf 目录下。 yum install samba samba-client 2.配置一个通过samba访问Linux文件夹时,需要用到的用户名和密码。这个用户名需要 是 linux 用户名(可新增用户名),接着设置密码,如果用户在 linux 不存在则设置密码错误。 smbpasswd -a 用户名 3.在 linux 上面创建一个 对外分享的文件夹。 mkdir /usr/redis 4. 在配置文件中,添加这个我们想共享的文件夹的路径和一些配置信息: vim /etc/samba/smb.conf [share_name] # 符号[ ]里面的是共享文件夹对外的名字,称为共享名字,注意 [ ] 不能去掉。 path = /usr/redis # 这个path就是你想共享的那个文件夹的路径 available = yes valid users = 用户名 #这个users,就是我们刚才在第二步创建的那个用户名 read only = no browsable = yes public = yes 5.重启 smb systemctl restart smb 查询 smb 状态 systemctl status smb 6.在window系统查询我们分享的文件,输入 //ip

Exit codes of smbclient

六月ゝ 毕业季﹏ 提交于 2019-12-05 12:30:38
i've a problem with the commandline command "smbclient" of samba on arm. I wrote a script to download files from a Windows Share. Here the smb-part of this script. smbclient //CNAME/SNAME -I0.0.0.0 -N -c "case_sensitive; cd folder; prompt; mget file" echo $? My problem ar the exit codes. If the file is downloaded completely, the exit code is 0 (OK) If the file cannot be downloaded, the exit code is 1 (OK) If the testmaschine loses the connection to the share due downloading a file, the exit code is 0 (NOT GOOD), but error ("Lost connection...etc.") is written to console. (OK) I tried it with

PJzhang:ms17-010永恒之蓝漏洞在windows 2008R2中的复现

為{幸葍}努か 提交于 2019-12-05 11:07:45
猫宁!!! 参考: https://www.anquanke.com/post/id/86245 https://xz.aliyun.com/t/2536 https://www.cnblogs.com/backlion/p/9484949.html https://www.jianshu.com/p/91588e284fe8 “永恒之蓝”利用Windows系统的SMB漏洞可以获取系统最高权限,危害极大。 微软的漏洞2个漏洞公告 https://support.microsoft.com/zh-cn/help/4012598/title https://docs.microsoft.com/zh-cn/security-updates/Securitybulletins/2017/ms17-010?redirectedfrom=MSDN windows 2008R2镜像从itellme站点获取,种类齐全,比较干净。 https://msdn.itellyou.cn/ 记得进行新建,建立系统保留分区哦,用于存放系统引导文件,类似于centos7的/boot分区,可以避免系统无法正常启动。 虚拟机中的Windows 2008 R2一定要设置为网卡桥接模式 ip是192.168.100.27,先用nmap扫描一下有没有永恒之蓝漏洞存在,扫描脚本在/usr/share/nmap

JCIFS SmbException

↘锁芯ラ 提交于 2019-12-05 02:52:49
I am trying to access a shared folder in my company network via JCIFS. But when i try to list the files under the shared folder, it throws an SmbException as below, jcifs.smb.SmbException: 0xC000009A at jcifs.smb.SmbTransport.checkStatus(SmbTransport.java:563) at jcifs.smb.SmbTransport.send(SmbTransport.java:663) at jcifs.smb.SmbSession.sessionSetup(SmbSession.java:316) at jcifs.smb.SmbSession.send(SmbSession.java:218) at jcifs.smb.SmbTree.treeConnect(SmbTree.java:176) at jcifs.smb.SmbFile.doConnect(SmbFile.java:911) at jcifs.smb.SmbFile.connect(SmbFile.java:954) at jcifs.smb.SmbFile.connect0