Ubuntu12.04 安装Samba

Ubuntu12.04 安装Samba

本教程介绍了在Ubuntu12.04安装Samba文件服务器,以及如何配置它通过SMB协议共享文件,以及如何将用户添加。Samba的配置,而不是作为一个独立的服务器作为域控制器。在安装,每个用户都有自己的家目录通过SMB协议和所有用户有几次读写访问的共享目录访问。

1初步说明
我这里使用的Ubuntu12.04系统与主机名为server1.example.com和IP地址192.168.0.100。

我所有在本教程中的步骤以root权限运行,所以确保你以root身份登录:

sudo su

2安装Samba
连接到服务器,并安装了Samba软件包:

apt-get install libcups2 samba samba-common

编辑smb.conf文件:

vi /etc/samba/smb.conf

在全球的部分,删除的行的安全开始=用户,所以它看起来像这样的“#”:

[...]

#
"security = user" is always a good idea. This will require a Unix
account

# in this
server for every user accessing the server. See

#
/usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html

# in the
samba-doc package for details.

security = user

这使Linux系统的用户登录到Samba服务器。

关闭该文件并重新启动Samba:

/etc/init.d/smbd restart

3添加Samba共享
现在,我将添加一个份额,是所有用户访问。

创建共享文件的目录,并更改该组的用户组:

mkdir -p /home/shares/allusers
chown -R root:users /home/shares/allusers/
chmod -R ug+rwx,o+rx-w /home/shares/allusers/

在文件/etc/samba/smb.conf中添加以下几行:

vi /etc/samba/smb.conf

[...]

[allusers]

comment = All Users

path
= /home/shares/allusers

valid
users = @users

force
group = users

create mask = 0660

directory mask = 0771

writable = yes

[...]

[homes]

comment = Home Directories

path = /home/

public = yes

writable = yes

上面的配置可以对所有用户可见。

如果你希望所有用户都能够通过Samba其主目录读写的/ etc / samba / smb.conf中添加以下几行:

[...]

[homes]

comment = Home Directories

browseable = no

valid users = %S

writable = yes

create mask = 0700

directory mask = 0700

现在我们重新启动Samba:

/etc/init.d/smbd restart

4添加和管理用户
在这个例子中,我将添加名为汤姆用户。您可以添加尽可能多的用户,你需要以同样的方式,只需更换与在命令所需的用户名,用户名汤姆。

useradd tom -m -G users

Linux系统的用户数据库中的密码设置为汤姆。如果用户tom不应该能够登录到Linux系统,跳过这一步。

passwd tom

- >输入新用户的密码。

立即将用户添加到Samba用户数据库:

smbpasswd -a tom

- >输入新用户的密码。

现在,你应该能够从您的Windows文件浏览器使用的用户名和汤姆对所选择的密码和存储文件(地址是\\192.168.0.100or \\192.168.0.100\tom的家目录)工作站在登录Linux服务器在汤姆的家目录,或在公共共享目录。

Ubuntu12.04 安装Samba的更多相关文章

  1. 【转】win7 虚拟机virtualbox中ubuntu12.04安装samba实现文件共享

    原文网址:http://blog.csdn.net/watkinsong/article/details/8878786 昨天心血来潮,又装了个虚拟机,然后安装了ubuntu12.04,为了实现在虚拟 ...

  2. Ubuntu12.04安装64位系统出现编译错误error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or dir

    问题: Ubuntu12.04安装64位系统出现编译错误error while loading shared libraries: libz.so.1: cannot open shared obje ...

  3. ubuntu12.04安装svn 1.7(转载)

    ubuntu12.04安装svn 1.7 分类: ubuntu2013-10-22 16:03 239人阅读 评论(0) 收藏 举报 svnubuntu   目录(?)[+]   1.问题     在 ...

  4. ubuntu12.04 安装 php5.4/php5.5

    1:修改源(我使用163的源)直接修改/etc/apt/sources.list deb http://mirrors.163.com/ubuntu/ precise main universe re ...

  5. Ubuntu12.04安装java6

    按照android官方文档 http://source.android.com 下载编译android源代码,jdk安装失败,尝试一下方法成功(2013-11-20) 下面我就把在Ubuntu12.0 ...

  6. [分享]Ubuntu12.04安装基础教程(图文)

    [分享]Ubuntu12.04安装基础教程(图文) 原文地址: http://teliute.org/linux/Ubsetup/lesson21/lesson21.html 1.进入 live cd ...

  7. Ubuntu14.04安装samba

    Ubuntu14.04安装samba 按照惯例,首先介绍Samba.Samba是在Linux系统上实现的SMB(Server Messages Block,信息服务块)协议的一款免费软件.它实现在局域 ...

  8. ubuntu12.04 安装nginx+php+mysql (lnmp)的web服务器环境

    1.Ubuntu12.04 安装nginx+php+mysql (lnmp)的web服务器环境 http://blog.db89.org/ubuntu12-04-install-nginx-php-m ...

  9. Ubuntu 18.04安装Samba服务器及配置

    Ubuntu 18.04安装Samba服务器及配置 局域网下使用samba服务在Linux系统与Windows系统直接共享文件是一项很方便的操作.以Ubuntu为例配置samba服务,Linux服务器 ...

随机推荐

  1. mkdir

    1,mkdir Problem: You want to use the mkdir() function from the sys/stat.h POSIX header, but you don’ ...

  2. 调试 rewrite

    等号后面是变量 访问http://m-test.jinlianchu.com/member/register.html?inviteCode=jlc24639  的跳转到https://wx-test ...

  3. EF Code First教程-02.1 Fluent API约定配置

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.D ...

  4. iOS小技巧2

    这段代码是实现了类似QQ空间"我的空间"里面的圆形头像 //圆形的头像 UIImageView * headImage = [[UIImageView alloc]initWith ...

  5. Java 多态 虚方法

    Java中多态的实现方式:接口实现,继承父类进行方法重写,同一个类中进行方法重载. 看代码: package com.company; public class Main { public stati ...

  6. Redhat linux 挂载命令mount

    命令格式: mount [-t vfstype] [-o options] device dir 其中: 1.-t vfstype 指定文件系统的类型,通常不必指定.mount 会自动选择正确的类型. ...

  7. git打tag 三步骤

    git status git tag publish/1.0.0 git push origin publish/1.0.0

  8. Android Push Notification实现信息推送使用

    本贴在http://www.cnblogs.com/hanyonglu/archive/2012/03/16/2399655.html下略为改动. Apndroid Push Notification ...

  9. java Servlet中的过滤器Filter

    web.xml中元素执行的顺序listener->filter->struts拦截器->servlet. 1.过滤器的概念 Java中的Filter 并不是一个标准的Servlet ...

  10. Lintcode: Product of Array Exclude Itself

    Given an integers array A. Define B[i] = A[0] * ... * A[i-1] * A[i+1] * ... * A[n-1], calculate B wi ...