How to install Samba server on Ubuntu 12.04

Part 1: Configuring anonymous share with samba server

To install the samba package,enter the following command:

sudo apt-get install samba samba-common

Check the version of installed samba software by using this command:

smbd --version

Also install these suggested packages for samba:

sudo apt-get install python-glade2 system-config-samba

Go to your Windows machine and use this command in order to check the WORKGROUP name:

net config workstation

It will show the output, something like this:

Backup the smb.conf file, then delete it and create the new one:

sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
sudo rm /etc/samba/smb.conf
sudo touch /etc/samba/smb.conf
sudo nano /etc/samba/smb.conf

Add this, in your smb.conf file (or change it according to your requirement):

#======================= Global Settings =====================================
[global]
workgroup = WORKGROUP
server string = Samba Server %v
netbios name = ubuntu
security = user
map to guest = bad user
dns proxy = no
#============================ Share Definitions ==============================
[MyShare]
path = /samba/share
browsable =yes
writable = yes
guest ok = yes
read only = no

Save the smb.conf file and restart the service:

sudo service smbd restart

Access the samba share from windows (where ubuntu is the name of my samba server):

wao, we are able to access the samba share successfully :-)

Let’s try to create something, inside the share folder:

Error, we cannot create anything inside the share folder :-(

Check the current permission on the samba share:

cd /samba/
ls -l

Change it, in such a way that everyone can read and write it(Check it, that it is allowed in your environment or not):

sudo chmod -R 0777 share
ls -l

Try to create something again, inside the share folder:

Verify the newly created file on samba server:

cd share/
ls -l 

 

Part 2: Add and manage users and groups

Add a group in your ubuntu server (in my case smbgrp):

sudo addgroup smbgrp

Create a new share, set the permission on the share ,add the user to the samba group and create samba password:

cd /samba/
sudo chown -R arbab:smbgrp secure/
ls -l
sudo chmod -R 0770 secure/
ls -l
sudo adduser arbab smbgrp
sudo smbpasswd -a arbab

Add the newly created samba share in smb.conf file:

[secure]
 path = /samba/secure
 valid users = @smbgrp
 guest ok = no
 writable = yes
 browsable = yes
 create mask = 0777

Restart the samba service and check the syntax error with testparm:

sudo service smbd restart
sudo testparm

Testing from Windows Machine:

Verification from Ubuntu server:

cd /samba/secure/
ls -l

Hope this will help you!

Please Remember me in your prayers!

Source page from : http://rbgeek.wordpress.com/2012/04/25/how-to-install-samba-server-on-ubuntu-12-04/

时间: 2024-12-13 07:56:11

How to install Samba server on Ubuntu 12.04的相关文章

Install Asterisk 11 on Ubuntu 12.04 LTS

http://blogs.digium.com/2012/11/14/how-to-install-asterisk-11-on-ubuntu-12-4-lts/ Last week I put up an install guide for Asterisk 11 on CentOS 6. Asterisk 11 is the latest LTS release of Asterisk with many great new features and long term support! T

Install eclipse ns3 in ubuntu 14.04

1. NS3 install 参考NS3 tutorial即可. 2.eclipse 2.1下载 下载地址:http://www.eclipse.org/downloads/               Eclipse IDE for C/C++ Developers NOTE: you can know whether your ubuntu is 32-bit or 64-bit by executing the command "uname -m". 如果显示i686,你安装了3

Ubuntu 12.04 Server LTS下安装桌面及vncserver

亲测通过 1. 安装相关的包: apt-getupdate apt-get install ubuntu-desktop apt-getinstall vnc4server apt-get install x-window-system-core apt-get install gdm apt-get install gnome-panel 2. 设置vncserver Vncpasswd 以root身份chmod +x/etc/X11/xinit/xinitrc Vi /root/.vnc/x

U盘安装 Ubuntu 12.04 Server LTS

折腾了半天12.04 server版,遇到的问题,貌似难度比10.04大很多: 首先是低版本的ultraISO不支持12.04映像刻录,只显示出EFI, 所以只能下个高版本的9.5.5(UUI被证明是不可行的) 其次是按照10.04来做的话,Help->F6根本没有地方输入installcdrom-detect/try-usb=true.(找了好久,实在是找不到,网上没有找到的...好吧,其实就是没有) 经过各种折腾,在网上看到一个很有价值的文章,终于试成功了一个办法: 1. 用UltraISO

ubuntu 12.04 server 安装nginx

下载源码: wget http://nginx.org/download/nginx-1.6.1.tar.gz 解压,编译安装 ./configure ./configure: error: the HTTP rewrite module requires the PCRE library. You can either disable the module by using --without-http_rewrite_module option, or install the PCRE li

linux 下 VNC Server安装配置及 eclipse CDT C/C++ 开发环境搭建(我用的是阿里云服务器 ubuntu 12.04 64-bit,无图形化界面)

linux 下 VNC Server安装配置及 eclipse CDT C/C++ 开发环境搭建(我用的是阿里云服务器 ubuntu 12.04 64-bit,无图形化界面): 既然要用 eclipse 可视环境下开发,那首先要安装图形界面喽!!! 对开发者来说,个人认为 linux 选择界面优先选择顺序:Awesome(性能最好) > Xfce4 > gnome > unity-2d //////////////////////////////////////////////// 首先

在Ubuntu 12.04安装和设置Samba实现网上邻居共享

Samba 是一款功能强大的共享工具,可以实现与windows的共享,就是我们经常在windows计算机之间使用的网上邻居功能,可以共享文件和打印机等.今天要介绍的是在 ubuntu 12.04 中安装和设置,当然也可以在以前的版本上使用. 在Ubuntu上安装Samba: 1 安装Samba文件 我们需要做的第一件事是安装Samba,你可以在Ubuntu软件中心搜索软件,然后安装.如果你想通过终端安装,可复制这个命令: sudo apt-get install samba samba-comm

ubuntu 12.04 server ntp同步

ubuntu和windows对计算机硬件保存的时间解释可能是不一样的.windows默认把硬件时间当做local time,而ubuntu把硬件时间当做UTC(Coordinated Universal Time 世界统一时间). ubuntu 默认开启UTC,不过可以关闭UTC,方法:sudo gedit /etc/default/rcS 把UTC=yes 修改成UTC=no .这样ubuntu就可以把硬件时间当做local time 了.如果您的ubuntu 服务器时间已经不准确了,可以用以

Ubuntu 12.04 Server OpenStack Havana多节点(OVS+GRE)安装

1.需求 节点角色 NICs 控制节点 eth0(10.10.10.51)eth1(192.168.100.51) 网络节点 eth0(10.10.10.52)eth1(10.20.20.52)eth2(192.168.100.52) 计算结点 eth0(10.10.10.53)eth1(10.20.20.53) 注意1:你总是可以使用dpkg -s <packagename>确认你是用的是Havana版本 注意2:这个是当前网络架构 2.控制节点 2.1.准备Ubuntu 安装好Ubuntu