linux下的文件服务器[ftp(ftp/tftp)、 Samba、NFS服务器
来源:互联网 发布:少女时代930事件知乎 编辑:程序博客网 时间:2024/05/24 23:11
Linux文件服务器:ftp服务器(ftp/tftp)、 Samba服务器、NFS服务器。
ftp的客户可以是任意平台,samba是专门针对windows客户,而NFS则是面向linux/unix用户的。下面是三种服务器的对比情况:
服务器名称
FTP
Samba
NFS
接下来我们就逐个来配置和运行这些服务器。
NFS服务器 --是一种基于远程过程调用(RPC)的分布式文件系统架构
1. Check if NFS software package is installed
rpm -qa | grep nfs 或者 rpm -q nfs-utils portmap
2. Set up NFS server:
Edit /etc/exports file to add your configuration
3.Start the NFS server
After changing the /etc/exports file, it must be reloaded by entering:
# exportfs -ra
Start the services:
# service portmap start; //portmap的功能是启用远程过程调用,检查portmap服务是否启动(# ps aux | grep portmap)。
# service nfs start
// 先启动portmap(service protmap restart),再启动nfs(service nfs start)
4. Add them to the start configuration with:
/sbin/chkconfig --level 35 portmap on
/sbin/chkconfig --level 35 nfs on
/sbin/chkconfig --level 35 nfslock on
// 先启动portmap(service protmap restart),再启动nfs(service nfs start)
4. Add them to the start configuration with:
/sbin/chkconfig --level 35 portmap on
/sbin/chkconfig --level 35 nfs on
/sbin/chkconfig --level 35 nfslock on
If the services are not present in the level management add them with "--add" chkconfig option.
Verify that the daemons are running with
/usr/sbin/rpcinfo -p
/usr/sbin/rpcinfo -p
查看nfs的当前状态
5. 在客户端挂接NFS共享出来的目录。先在客户端创建一个挂接点,如 # mkdir /mnt/nfs ,
Samba服务器
这个世界既非只有linux/unix,也不是由microsoft windows 独霸天下的格局。也许出于linux/unix与windows既竞争又共存的事实,人们开发了 linux给windows用户提供文件共享的工具Samba,这应该算得上linux的开放精神吧!
1、 检查是否安装samba软件包。# rpm –qa | grep smb ,如果没有则自行安装samba。
2、 修改配置文件/etc/samba/smb.conf。早期的linux版本的配置文件smb.conf的安全选项“security=share”,这个默认值是个安全隐患,不过现在流行的linux版本的安全选项的默认值是“security=user”。如果只想用户对他的目录拥有只读权限,就把选项“writeable=yes”改成“read only=yes”。其他的选项根据自己的要求更改即可。对于一般的应用而言,基本上不用修改这个文件。
3、 添加系统账户。由于smb的访问是使用系统账号进行的,因此添加账号是必不可少的。这个比较简单,用命令 # useradd sery , # passwd sery,就可以依次添加若干系统账号。
4、 建立Samba用户密码文件。虽然samba的用户是系统用户,但出于安全考虑,samba用户的密码并非创建系统用户时设定的用户密码。为了生成smb所需的密码,应该进行下面的操作:
# cat /etc/passwd | mksmbpasswd.sh > /etc/samba/smbpasswd
# smbpasswd sery //为系统用户设置smb口令
# chown root.root /etc/samba/smbpasswd
# chmod 600 /etc/samba/smbpasswd //不准别的用户访问
5、 启用Samba服务器。我比较喜欢用 # service smb start 这种方式。
6、 检查服务是否正常启动。# service smb status 或者 # ps aux | grep smb。
7、 windows客户端访问 Samba服务器共享目录。在windows环境下,右键点击“网上邻居”图标,然后左击“搜索计算机”,把Samba服务器的IP地址填写在“计算机名”搜索栏,点击立即搜索。找到后双击图标,然后输入在Samba服务器上预先设定的用户名和密码,就能合法访问Samba服务器设定的共享资源。为了方便使用,可以把Samba服务器提供的共享目录映射成本地驱动器。
8、 其他。上述配置的samba服务器,用户的访问共享目录是系统账号的主目录。要想把共享目录设置到其他位置,修改Samba 的配置文件/etc/samba/smb.conf文件即可。
1、
2、
3、
4、
# cat /etc/passwd | mksmbpasswd.sh > /etc/samba/smbpasswd
# smbpasswd sery
# chown root.root /etc/samba/smbpasswd
# chmod 600 /etc/samba/smbpasswd
5、
6、
7、
8、
FTP服务器
在linux 环境下,有三个主要的FTP服务器:vsftpd、proftpd和wu-ftpd。
在linux 环境下,有三个主要的FTP服务器:vsftpd、proftpd和wu-ftpd。
1、 检查是否安装vsftp包。# rpm –qa | grep vsftpd。如果没有则安装它。
2、 修改配置文件。Vsftpd的配置文件为/etc/vsftpd/vsftpd.conf,如果不打算提供匿名访问的话,需要修改配置文件 /etc/vsftpd/vsftpd.conf的项“anonymous_enable=Yes”为“anonymous_enable=No”。
3、 启用vsftpd服务。#service vsftpd start。
2、
3、
或者:
4、
5、
Usually the TFTP sevice is by default started in Linux. you only need to doulble check if not sure.
#/bin/netstat -a|grep udp
1. Firstly, Configuring the TFTP server
#vi /etc/xinetd.d/tftp
2. Secondly, restart the xinetd service:
# /sbin/service xinetd restart
3. To get xinetd configured to start at boot you can use the chkconfig command.
#chkconfig xinetd on
# /sbin/service xinetd restart
3. To get xinetd configured to start at boot you can use the chkconfig command.
#chkconfig xinetd on
服务器名称
NFS /etc/init.d/nfs /etc/init.d/nfslock /usr/sbin/rpc.nfsd /usr/sbin/rpc.mountd /etc/exports
Samba /etc/init.d/smb /etc/init.d/winbind /usr/sbin/smbd /usr/sbin/nmbd /etc/samba/smb.conf
vsftpd etc/xinetd.d/vsftpd /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf
Samba
vsftpd
0 0
- linux下的文件服务器[ftp(ftp/tftp)、 Samba、NFS服务器
- linux下的文件服务器 FTP, NFS, Samba
- ftp服务器(ftp/tftp)、 Samba服务器、NFS服务器的区别
- ftp服务器(ftp/tftp)、 Samba服务器、NFS服务器的区别
- ftp服务器(ftp/tftp)、 Samba服务器、NFS服务器的区别
- linux下的ftp服务器的搭载(文件服务器2)
- ubuntu 下配置NFS,samba, telnet,TFTP,ftp,DHCP服务
- FTP、TFTP、NFS的区别
- FTP、TFTP、NFS的区别
- ftp服务器、 Samba服务器、NFS服务器的区别
- ftp服务器(ftptftp)、-Samba服务器、NFS服务器的区别
- tftp服务器 tftp建立嵌入式系统下的ftp服务器
- linux下服务器的架设(dhcp,nis,samba,ftp,dns)
- Linux 下的FTP, TFTP命令
- 网络共享(Ftp,NFS,Samba)-------NFS
- linux下的FTP,SAMBA配置笔记
- Linux曲径通幽:文件共享(FTP、Samba、NFS、SCP、RSYNC)
- 文件服务器 FTP服务器
- iOS打包pod spec
- 自定义弹出提示框
- Oracle关于创建存储过程权限问题以及带参数的游标的范例
- 用PL/SQL导出SQL语句
- java 通配符解惑
- linux下的文件服务器[ftp(ftp/tftp)、 Samba、NFS服务器
- find指令详解
- css3小知识点收录
- 关于c++中cin获取字符串的某些问题
- 转载-JAVA并发多线程
- C#关闭后台进程
- Mysql插入数据报错处理
- svn之Locked
- 蚂蚁的难题(二)