nfs服务器配置
第一步:安装相关软件包。
apt-get install nfs-kernel-server
第二步:修改配置文件/etc/exports,设置供共享的目录。
# /etc/exports: the access control list for filesystems which may be exported
#to NFS clients. See exports(5).
#
# Example for NFSv2 and NFSv3:
#/srv/home shostname1(rw,sync,no_subtree_check) \
hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check)
#
/nfs *(rw,sync,no_subtree_check)
此/nfs目录为共享目录
第三步:重启nfs服务器,在命令行输入:/etc/init.d/nfs-kernel-server restart
第四步:测试nfs服务,测试方法如下:
在命令行输入:mount -t nfs -o nolock 192.168.1.19:/nfs /mnt
解释如下:
把nfs服务器中/nfs目录的内容挂载到/mnt目录中。
进入到/mnt中,可以查看到/mnt中的内容和/nfs中的内容一样。
第一步:安装相关软件包。
apt-get install nfs-kernel-server
第二步:修改配置文件/etc/exports,设置供共享的目录。
# /etc/exports: the access control list for filesystems which may be exported
#to NFS clients. See exports(5).
#
# Example for NFSv2 and NFSv3:
#/srv/home shostname1(rw,sync,no_subtree_check) \
hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check)
#
/nfs *(rw,sync,no_subtree_check)
此/nfs目录为共享目录
第三步:重启nfs服务器,在命令行输入:/etc/init.d/nfs-kernel-server restart
第四步:测试nfs服务,测试方法如下:
在命令行输入:mount -t nfs -o nolock 192.168.1.19:/nfs /mnt
解释如下:
把nfs服务器中/nfs目录的内容挂载到/mnt目录中。
进入到/mnt中,可以查看到/mnt中的内容和/nfs中的内容一样。
解除挂载,退出/mnt目录,在命令行中输入:umount /mnt
ssh服务器配置
第一步:安装相关软件包。
apt-get install openssh-server (ubuntu默认安装了ssh的客户端)
第二步:重启ssh服务,在命令行输入:/etc/init.d/ssh restart
第三步:测试ssh服务,测试方法如下:
1、 在ubuntu命令行输入:ssh 192.168.1.19 (此IP为ssh服务器IP)。
然后提示,输入用户名和密码。
2、 在windows下通过ssh客户端程序,来登录到ssh 服务器上。如:SSH Secure File Transfer Client。