Ubuntu安装配置samba
2009-10-18 21:54
423 查看
1、安装samba服务
sudo apt-get install samba
2、添加samba用户
sudo useradd username
编辑用户密码
sudo smbpasswd -a username
删除用户
sudo smbpasswd -x username
3、修改smb.conf配置文件
sudo vim /etc/samba/smb.conf
在最后添加如下内容:
[Share]
comment = Share Folder
path = /home/Jacky/Desktop/samba
browseable = yes
writable = yes
4、重新启动samba服务
sudo /etc/init.d/samba restart
5、在windows中访问samba服务器
注意:
1)、关于selinux,请关闭selinux,在/etc/selinux/config中设置selinux为disabled。
2)、关于firewall设定:
详细可参考samba官网:http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/securing-samba.html#firewallports
If you are setting up a firewall, you need to know what TCP and UDP ports to allow and block. Samba uses the following:
The last one is important because many older firewall setups may not be aware of it, given that this port was only added to the protocol in recent years.
When configuring a firewall, the high order ports (1024-65535) are often used for outgoing connections and therefore should be permitted through the firewall. It is prudent to block incoming packets on the high order ports except for established connections.
修改/etc/sysconfig/iptables
-A INPUT -m state --state NEW -m udp -p udp --dport 137 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 138 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 445 -j ACCEPT
(说明:在httpd服务中,需开启80端口,开启方法添加如下一行:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT)
重启防火墙服务
service iptables restart
或/etc/rc.d/init.d/iptables restart
重启samba服务
/etc/rc.d/init.d/smb restart
sudo apt-get install samba
2、添加samba用户
sudo useradd username
编辑用户密码
sudo smbpasswd -a username
删除用户
sudo smbpasswd -x username
3、修改smb.conf配置文件
sudo vim /etc/samba/smb.conf
在最后添加如下内容:
[Share]
comment = Share Folder
path = /home/Jacky/Desktop/samba
browseable = yes
writable = yes
4、重新启动samba服务
sudo /etc/init.d/samba restart
5、在windows中访问samba服务器
注意:
1)、关于selinux,请关闭selinux,在/etc/selinux/config中设置selinux为disabled。
2)、关于firewall设定:
详细可参考samba官网:http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/securing-samba.html#firewallports
Using a Firewall
Many people use a firewall to deny access to services they do not want exposed outside their network. This can be a good idea, although I recommend using it in conjunction with the above methods so you are protected even if your firewall is not active for some reason.If you are setting up a firewall, you need to know what TCP and UDP ports to allow and block. Samba uses the following:
Port 135/TCP - used by smbd |
Port 137/UDP - used by nmbd |
Port 138/UDP - used by nmbd |
Port 139/TCP - used by smbd |
Port 445/TCP - used by smbd |
When configuring a firewall, the high order ports (1024-65535) are often used for outgoing connections and therefore should be permitted through the firewall. It is prudent to block incoming packets on the high order ports except for established connections.
修改/etc/sysconfig/iptables
-A INPUT -m state --state NEW -m udp -p udp --dport 137 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 138 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 445 -j ACCEPT
(说明:在httpd服务中,需开启80端口,开启方法添加如下一行:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT)
重启防火墙服务
service iptables restart
或/etc/rc.d/init.d/iptables restart
重启samba服务
/etc/rc.d/init.d/smb restart
相关文章推荐
- Ubuntu10.04 Samba服务安装与配置
- Ubuntu下Samba安装配置及使用
- Ubuntu 文件服务器--samba的安装和配置
- Ubuntu文件服务器简单配置--samba的安装和配置
- ubuntu安装配置samba服务
- Ubuntu中Samba的安装配置和使用
- Ubuntu安装配置samba
- ubuntu 12.04安装配置samba
- Ubuntu中Samba的安装配置和使用
- ubuntu安装 配置samba
- Ubuntu中Samba的安装配置和使用[图文]
- ubuntu安装配置samba服务
- Ubuntu---samba(安装、配置、使用)OK
- Ubuntu和CentOS下安装配置samba服务详细过程(超级简单的smb.conf)
- Ubuntu中samba的安装与配置
- VM中 Ubuntu14.04 中Samba的安装配置和使用
- ubuntu安装配置samba服务
- Ubuntu 14.04 文件服务器--samba的安装和配置
- Ubuntu中Samba的安装配置和使用
- ubuntu samba共享安装 配置