samba

BASH: Strip new-line character from string (read line)

前提是你 提交于 2019-12-05 16:07:56
问题 I bumped into the following problem: I'm writing a Linux bash script which does the following: Read line from file Strip the \n character from the end of the line just read Execute the command that's in there Example: commands.txt ls ls -l ls -ltra ps as The execution of the bash file should get the first line, and execute it, but while the \n present, the shell just outputs "command not found: ls" That part of the script looks like this read line if [ -n "$line" ]; then #if not empty line

在Linux中搭建 samba服务器

白昼怎懂夜的黑 提交于 2019-12-05 15:17:08
下面说一下如何在RHEL5.4中搭建samba服务器,在搭建samba服务器之前要了解: (1)samba服务器是干什么用的; (2)它的主要作用是什么; (3)它在什么情况下会使用到。 SMB协议 SMB协议是在 局域网中共享文件/打印机 的一种协议,该协议可以为网络内部的Windows和Linux主机提供文件系统、打印服务。 SMB的工作原理是让NetBIOS和SMB运行在TCP/IP之上,且使用NetBIOS的nameserver让Linux机器可以在Windows网络邻居中被浏览。这样Windows就可以方便地与linux进行资源的共享了。 Samba Samba是一种用来实现SMB的软件,是运行在Linux环境里的自由软件。 它的主要功能包括以下几点: 1. 共享目录 :就是将服务器上的一个或几个目录设置为共享,例处在同一局域网内的Windows用户可以访问这些目录。 2. 共享打印机 :可共享服务器中的打印机,供其他客户机使用。 3. 控制共享资源的权限 :对于设置的资源(目录和打印机),可以通过权限设置,控制不同的用户具有不同的操作权限。 4. Linux 访问Windows共享资源: 在Linux客户端,可以使用 smbclient 客户端软件登录,与使用FTP类似的方式 访问Windows共享资源 。 搭建Samba服务器: 一、 首先就是安装Samba了

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

samba

最后都变了- 提交于 2019-12-05 11:33:33
基础概述 安装samba 探测主机上有哪些共享 基础概述 安装samba 查看samba-clien提供的工具 探测主机上有哪些共享 smbclient 关键字 -L 172.16.26.27 指定主机名 -U test 指定用户 Sharename 共享名 Comment 注释信息 来源: https://www.cnblogs.com/hao-ran/p/11922672.html

linux centos创建共享目录 samba share

半腔热情 提交于 2019-12-05 11:23:38
我的例子: 1. #yum install samba 2. #mkdir /home/share 3. #chmod 777 /home/share 4. vi /etc/samba/smb.conf #security=user 后面添加: security=share 在文件结尾添加如下行: [share] comment=this is Linux share directory path=/home/share public=yes writable=yes 5. /etc/init.d/smb start --------------------------------------------------------------------------------------------------------------------------------------- 网上搜索的资料: 首先,安装samba软件,我采用的是yum安装,因为这个真的很方便,而且个人感觉这种对版本要求不是很高,就大可不必用源码编译的安装 先查看一下是否有samba软件已经安装,我用的centos 6.3 64bit, rpm -qa | grep samba samba-common-3.5.10-125.el6.i686 samba-client-3.5.10-125.el6.i686

2.树莓派3安装archlinux配置web、samba和aria2

ε祈祈猫儿з 提交于 2019-12-05 09:15:29
本文永久更新地址:https://my.oschina.net/bysu/blog/1572517 archlinux一些常规配置,请看《 1.树莓派3安装archlinux通用配置部分 》 1.配置web服务(基于LAMP) 英文文档比较丰富: https://wiki.archlinux.org/index.php/Apache_HTTP_Server 1.1 先安装Apache、PHP pacman -Sy php php-apache php-gd 【上面命令会自动安装Apache、PHP】 先启动一下Apache看报什么错误 [root@alarm alarm]# apachectl AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::ba27:ebff:fe34:38d5. Set the 'ServerName' directive globally to suppress this message 配置apache: vi /etc/httpd/conf/httpd.conf 查找ServerName,会看到#ServerName www.example.com:80。把前面的注释#去掉,然后改成你自己的主机名

Linux:搭建samba服务器

时光总嘲笑我的痴心妄想 提交于 2019-12-05 08:45:12
samba服务器的搭建 修改防火墙设置 firewall-cmd --permanent --add-service=samba //设置防火墙 firewall-cmd --reload //重新加载防火墙 安装samba服务并启动samba服务 yum install -y samba samba-client //安装服务 systemctl start smb.service nmb.service //启动服务 建立共享目录 mkdir /home/company 创建访问账号 useradd -s /sbin/nologin xzusr smbpasswd -a xzusr 选项说明: -a 添加 smb 帐号; -x 删除 smb 帐号; -d 禁用 smb 帐号; -e 启用 smb 帐号 修改配置文件 修改配置文件:/etc/samba/smb.conf [company] //共享名称为 company comment = company share//共享注释 path = /home/company //指定共享路径 browseable = yes //所有人可见 guest ok = no //拒绝匿名访问 writeable = yes //支持写入数据 valid users=xzusr,gcusr,xsusr //允许访问的用户列表 write

Mercurial: Problem with non-ascii letters in filenames between Windows and Linux

南笙酒味 提交于 2019-12-05 08:44:20
I have a central Hg repository on a samba server, and two working copies, one on a Ubuntu and one on a Windows 7 machine. Everything worked fine until I, by mistake, added to the project a file with a Russian letter in the name. I've done it in Linux. Mercurial has happily accepted it and in Linux everything still works. However I've discovered that I cannot pull changesets to Windows any longer. For hg pull I get pulling from ... searching for changes adding changesets transaction abort! rollback completed abort: empty or missing revlog for figures/interfDðÁsign.svg (The problematc filename

samba服务器搭建实验

拟墨画扇 提交于 2019-12-05 07:06:52
Samba服务器的搭建 特点 : 可以和其他操作系统共享文件 访问不了可能受到防火墙或者setenforce影响 查看 setenforce是Linux的selinux防火墙配置命令, 执行setenforce 0 表示关闭selinux防火墙。 Windows和Linux两边的samba服务都要开启 linux 共享 步骤: 1、首先关闭防火墙或者设置防火墙 #firewall-cmd --permanent --add-service=samba //设置防火墙 #firewall-cmd --reload //重新加载防火墙 2、安装并启动samba服务 yum install -y samba 已经添加了国内yum源和epel源 安装成功后启动并查看服务 3、创建访问账号 useradd -s /sbin/nologin xzusr useradd -s /sbin/nologin gcusr useradd -s /sbin/nologin xsusr #smbpasswd -a xzusr #smbpasswd -a gcusr #smbpasswd -a xsusr 【smbpasswd 选项说明:-a 添加 smb 帐号;-x 删除 smb 帐号;-d 禁用 smb 帐号;-e 启用 smb 帐号】 4、修改配置文件/etc/samba/smb.conf 默认情况下

samba远程代码执行漏洞

陌路散爱 提交于 2019-12-05 03:18:10
漏洞版本: Samba 3.5.0之后到4.6.4/4.5.10/4.4.14 测试版本: CVE: CVE-2017-7494 漏洞描述 2017年5月24日Samba发布了4.6.4版本,中间修复了一个严重的远程代码执行漏洞,漏洞编号CVE-2017-7494,漏洞影响了Samba 3.5.0 之后到4.6.4/4.5.10/4.4.14中间的所有版本。端口445。 触发条件 服务器打开了文件/打印机共享端口445 共享文件拥有访问以及写入权限 攻击者知道共享的目录路径 漏洞测试 测试环境 123 $ docker pull medicean/vulapps:s_samba_1启动环境$ docker run -d -p 445:445 -p 139:139 -p 138:138 -p 137:137 medicean/vulapps:s_samba_1 msf攻击模块 https://github.com/hdm/metasploit-framework/blob/0520d7cf76f8e5e654cb60f157772200c1b9e230/modules/exploits/linux/samba/is_known_pipename.rb