作者:陈瑞金[ptubuntu] Mail:ruijin.chen@gmail.com
始于2009年9月21日 下午
版本号:Debian-5.03, 2009年9月5日版
转载请注明出处,本文也是采用两篇网友的大部分内容,因此转载时,请也将下面“参考文章”的出处也一并加入!谢谢!
本文中难免有不足、遗漏、错别字和句子不通之处,如发现、或者有更新改变之处,请与我联系以及时修正和完善!
系统内核:Linux samba 2.6.26-2-686 #1 SMP Wed Aug 19 06:06:52 UTC 2009 i686 GNU/Linux
在安装配置的过程中不无需安装桌面或是其他服务.只需安装最其本的系统就可以了.在安装完后需要安装ssh/vim/g++/make.这些都是必需的.在安装后需要修改/etc/resolv.conf 你才可以正常上网.
ptubuntu@ptubuntu:~$ vi /etc/resolv.conf
nameserver 208.67.220.220
nameserver 203.67.181.36
nameserver 218.85.157.99
nameserver 202.101.98.55
nameserver 202.101.111.55
ptubuntu:/home/ptubuntu# aptitude update
ptubuntu:/home/ptubuntu# aptitude install ssh vi samba
在这里要修改一下ssh端口号还有设置不能以root登录.
ptubuntu:/home/ptubuntu# vi /etc/ssh/sshd_config
Port 9922
PermitRootLogin no
上面samba也安装完那么现在需要配置samba服务.
ptubuntu:/home/ptubuntu# vi /etc/samba/smb.conf
[homes]
comment = Home Directories
browseable = no# By default, the home directories are exported read-only. Change next
# parameter to ‘yes’ if you want to be able to write to them.
#writable =no
writable = yes# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
create mask = 0744
# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
directory mask = 0755
配置安就可以添加帐户了.
ptubuntu:/home/ptubuntu#adduser ptubuntu
ptubuntu:/home/ptubuntu#smbpasswd -a ptubuntu
这个设置完后如果你的资料是挂开其他的硬盘上那么你还需要做以下几个步骤:
修改/etc/passwd 还有设置目录权限.设我要挂载的硬盘是hdc1.ptubuntu是放在/hdc1/ptubuntu这个目录那么挂载的目录如下.这样就可以读取相对的目录的.还需要设置目录权限.
ptubuntu:/home/ptubuntu#mkdir /mnt/dhc1
ptubuntu:/home/ptubuntu#mount /dev/hdc1 /mnt/hdc1ptubuntu:/home/ptubuntu#vi /etc/passwd
ptubuntu:x:1001:1001:,,,:/mnt/hdc1/ptubuntu:/bin/bashptubuntu:/home/ptubuntu#chown ptubuntu:ptubuntu /mnt/hdc1/ptubuntu -Rf
ptubuntu:/home/ptubuntu#/etc/init.d/samba start
这样就完全可以了.
原创文章,转载请注明: 转载自PT Ubuntu Blog