ubuntu12.04 下安装配置samba
来源:互联网 发布:JavaScript什么是闭包 编辑:程序博客网 时间:2024/04/30 15:34
1.确保ubuntu12.04能上网。参考http://blog.csdn.net/hexiechina2010/article/details/50451909
2.apt-get upgrade 更新源
(1)如果出现
- Err http://archive.canonical.com natty InRelease
- Err http://security.ubuntu.com oneiric-security InRelease
- Err http://extras.ubuntu.com natty InRelease
- Err http://security.ubuntu.com oneiric-security Release.gpg
- Temporary failure resolving ‘security.ubuntu.com’
(2)如果还是不成功,检查一下源表
Ubuntu 12.04源列表 sudo vim /etc/apt/sources.list 是否正确,以前我把源表设置成本地文件夹了。
然后apt-get update
安装步骤
1、使用下列命令安装samba
sudo apt-get install samba
sudo apt-get install smbfs
sudo apt-get install smbfs
如果出现类似“目前安装samba所依赖的程序版本与目前已安装的版本符合”
openssh-server: Depends: openssh-client (= 1:5.3p1-3ubuntu3(版本旧)) but 1:5.3p1-3ubuntu5(版本新) is to be installed
E: Broken packages 此语句是网络找的,不是按照samba的,但意思一样,原来的找不到了,请见谅
这句话的意思是依赖旧的版本1:5.3p1-3ubuntu3,但目前1:5.3p1-3ubuntu5(版本新)已经安装。则需要降低版本
sudo apt-get install openssh-client= 1:5.3p1-3ubuntu3即可。
2、创建一个文件夹
mkdir ~/UbuntuSharesudo chmod 777 ~/UbuntuShare
sudo useradd ShareUseName
①备份一下配置文件
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
②用vim编辑配置文件
sudo vim /etc/samba/smb.conf
③添加配置信息
[Share] 网上找的。
path = ~/UbuntuShare
available = yes
browseable = yes
public = yes
writable = yes
valid users = ShareUseName
create mask = 0700
directory mask =0700
force user =nobody
force group = nogroup
#======================= Share Definitions =======================
243
244 # Un-comment the following (and tweak the other settings below to suit)
245 # to enable the default home directory shares. This will share eac h
246 # user's home director as \\server\username
247 [homes] 将此行的注释去掉,因为我的共享文件在家目录里,没有此行登陆不进去
248 comment = Home Directories
249 browseable = yes
sudo touch /etc/samba/smbpasswd
sudo smbpasswd -a ShareUseName
sudo smbpasswd -a book (用户名可以是系统用户名,book是我的系统的用户)
然后按照提示输入密码(假如:abc123)就好了。
6、重启samba服务器
sudo /etc/init.d/smbd restart7.此种配置方法,亲测后,只能登陆book
book@ubuntu:/home$ sudo smbclient //192.168.137.208/book -U book
Enter book's password:
Domain=[MYGROUP] OS=[Unix] Server=[Samba 3.6.3]
smb: \>
book@ubuntu:/home$ sudo smbclient //192.168.137.208/UbuntuShare -U book 不知道咋弄,反正能用家目录用了,先不弄了,工作要紧啊
Enter book's password:
Domain=[MYGROUP] OS=[Unix] Server=[Samba 3.6.3]
tree connect failed: NT_STATUS_BAD_NETWORK_NAME
常见错误
如tree connect failed: NT_STATUS_LOGON_FAILURE
网络搜索《Samba服务学习报错总结》
防止出现中文目录乱码的情况,请在、/etc/samba/smb.conf 中加入下面三行
[global]
display charset = UTF-8
unix charset = UTF-8
dos charset = cp936
这个是介绍samba与windowns通信原理方面的文章。http://blog.csdn.net/deansrk/article/details/6696193
这里贴一个安装和配置samba的文件 http://www.lupaworld.com/thread-872462-1-1.html
http://blog.chinaunix.net/uid-26748719-id-3782289.html
- ubuntu12.04 下安装配置samba
- Ubuntu12.04下samba配置与qt4.8.6安装
- ubuntu12.04 16.04 server下安装配置samba
- Ubuntu12.04下samba服务器共享配置
- Ubuntu12.04 安装及配置samba服务
- ubuntu12.04安装samba
- ubuntu12.04下samba、tftp、nfs的配置
- ubuntu12.04 amd64 安装 samba和配置VMWARE共享文件
- 安装samba服务及配置(Ubuntu12.04)
- ubuntu12.04 配置SAMBA服务
- ubuntu12.04samba服务器配置
- ubuntu12.04samba服务器配置
- ubuntu12.04samba服务器配置
- ubuntu12.04samba服务器配置
- ubuntu12.04samba服务器配置
- ubuntu12.04samba服务器配置
- ubuntu12.04samba服务器配置
- ubuntu12.04samba服务器配置
- 简历书写原则
- js表单验证
- UGUI ScrollRect滚动优化:无限循环利用Item
- 开放-封闭原则
- html知识复习
- ubuntu12.04 下安装配置samba
- poj-3185 The Water Bowls
- Mysql 里CHAR和VARCHAR的最大长度及一些注意事项
- 整数变换问题和N皇后问题解析(C语言)
- 七、Linux/UNIX操作命令积累【touch、chkconfig】
- getopt:命令行选项、参数处理
- POJ-3276 Face The Right Way
- android常见的库文件
- git学习推荐