route命令 #route add -host hostname or ip dev device #route add -net network-address netmask dey device #route add -net default gw hostname or IP #route #route add -host 192. 168.1.I dev eth0 #route add -net 192.168.1.0 dev eth0 # route add-net192.168.50.48255255.255240 dev eth0 #route add default gw 192. 168. 1. 1 dev etho #route del 192. 168.23.0
route命令 • #route add –host hostname or IP dev device • #route add –net network-address netmask dev device • #route add –net default gw hostname or IP • #route • #route add –host 192.168.1.1 dev eth0 • #route add –net 192.168.1.0 dev eth0 • #route add –net 192.168.50.48 255.255.255.240 dev eth0 • #route add default gw 192.168.1.1 dev eth0 • #route del 192.168.23.0
第21章服务器配置 21lNFS(网络文件系统)服务器 212NS(网络信息服务)服务器 213 Samba服务器 21.4 Apache服务器
第21章 服务器配置 • 21.1 NFS(网络文件系统)服务器 • 21.2 NIS (网络信息服务)服务器 • 21.3 Samba服务器 • 21.4 Apache服务器
21.1NFS服务器 安装好两个软件包: portmap nfs NFS基于RPC,所以需要 portmap服务 修改配置文件/ etc/exports RIt: /directory nfs-client-host-ip-or-name(access options) 例 wwwclientl.sina.com(ro,ro)client2.sinacom(ro) /wwwclientI.sina.com(rw)client2.sina.com(rw,sync) /www202202.104.104(ro) www202.202.5048/255255255240(rw) /www*sina.com(rw,insecure,sync,nowdelay,nosubtreecheck,insecurelocks) /www (ro) /pub linuxlab-??. swnu edu cn(noaccess)
21.1 NFS服务器 • 安装好两个软件包: portmap nfs • NFS基于RPC,所以需要portmap服务 • 修改配置文件/etc/exports 格式: /directory nfs-client-host-ip-or-name (access options) 示例: /www client1.sina.com(ro, ro) client2.sina.com(ro) /www client1.sina.com(rw) client2.sina.com(rw,sync) /www 202.202.104.104(ro) /www 202.202.50.48/255.255.255.240(rw) /www *.sina.com(rw,insecure,sync,no_wdelay,no_subtree_check,insecure_locks) /www (ro) /pub linuxlab-??.swnu.edu.cn(noaccess)
在NFS服务器和客户之间进行用户映射 通常并不希望NFS客户上的ro帐户对NHFS服务器安装的共享 目录享有ro的特权,所以NFS服务器默认使用 root squash /www *. swnu edu cn(root squash) 将ro0UD=0和GID=0)压缩到nobo www *. swnu edu cn(no root squash) 把客户root当作本地root /www *.swnu edu cn(anonuid-=500, anongid=666) 将ro缩到UID=500和GID=666 www *. swnu edu cn(all squash 将所有客户压缩到 nobody /www *. swnu edu cn(anonuid-=500, anongid=666, squash uids=0 100, squash gids=0-100 将0-100范围内的所有UID和GID压缩到 nobody UID=500和GID=66 www *. swnuedu cn(map static=/etc/nfs map) 编辑 nfs map文件来实现映射
在NFS服务器和客户之间进行用户映射 • 通常并不希望NFS客户上的root帐户对NFS服务器安装的共享 目录享有root的特权,所以NFS服务器默认使用root_squash. • /www *.swnu.edu.cn(root_squash) 将root(UID=0和GID=0)压缩到nobody • /www *.swnu.edu.cn(no_root_squash) 把客户root当作本地root • /www *.swnu.edu.cn(anonuid=500,anongid=666) 将root压缩到UID=500和GID=666 • /www *.swnu.edu.cn(all_squash) 将所有客户压缩到nobody • /www *.swnu.edu.cn(anonuid=500,anongid=666,squash_uids=0- 100,squash_gids=0-100) 将0~100范围内的所有UID和GID压缩到nobody UID=500和GID=666 • /www *.swnu.edu.cn(map_static=/etc/nfs.map) 编辑nfs.map文件来实现映射
在NFS服务器和客户之间进行用户映射 #cat /etc/nfs. map uid 0-100 #squash all remote uids in the 0-100 range gid 0-100 #squash all remote gids in the 0-100 range uid 500 666 #map remote uid 500 to local uid 666 gid 500 777 #map remote gid 500 to local gid 777
在NFS服务器和客户之间进行用户映射 • #cat /etc/nfs.map uid 0-100 #squash all remote uids in the 0-100 range gid 0-100 #squash all remote gids in the 0-100 range uid 500 666 #map remote uid 500 to local uid 666 gid 500 777 #map remote gid 500 to local gid 777