新服务器配置列表
网络:
使用静态 IP:
cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
#auto em1
#iface em1 inet dhcp
# static IP address for local ssh login
auto em1
iface em1 inet static
address 192.168.2.193
netmask 255.255.255.0
gateway 192.168.2.1
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
#auto em1
#iface em1 inet dhcp
# static IP address for local ssh login
auto em1
iface em1 inet static
address 192.168.2.193
netmask 255.255.255.0
gateway 192.168.2.1
自动更新固定 DNS
cat /etc/init.d/update-dns
#! /bin/sh
### BEGIN INIT INFO
# Provides: update-dns
# Required-Start:
# Required-Stop:
# X-Start-Before:
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Provide limited super user privileges to specific users
# Description: Provide limited super user privileges to specific users.
### END INIT INFO
N=/etc/init.d/update-dns
set -e
case "$1" in
start)
# make sure privileges don't persist across reboots
echo "nameserver 202.103.24.68" >> /etc/resolv.conf
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
;;
stop|reload|restart|force-reload)
;;
*)
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
#! /bin/sh
### BEGIN INIT INFO
# Provides: update-dns
# Required-Start:
# Required-Stop:
# X-Start-Before:
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Provide limited super user privileges to specific users
# Description: Provide limited super user privileges to specific users.
### END INIT INFO
N=/etc/init.d/update-dns
set -e
case "$1" in
start)
# make sure privileges don't persist across reboots
echo "nameserver 202.103.24.68" >> /etc/resolv.conf
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
;;
stop|reload|restart|force-reload)
;;
*)
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
runlevel
N 2
ls -l /etc/rc2.d/S76update-dns
lrwxrwxrwx 1 root root 20 12ÔÂ 1 17:26 /etc/rc2.d/S76update-dns -> ../init.d/update-dns
N 2
ls -l /etc/rc2.d/S76update-dns
lrwxrwxrwx 1 root root 20 12ÔÂ 1 17:26 /etc/rc2.d/S76update-dns -> ../init.d/update-dns
SAMBA 设置共享
tail -n 16 /etc/samba/smb.conf
# You may need to replace 'lpadmin' with the name of the group your
# admin users are members of.
# Please note that you also need to set appropriate Unix permissions
# to the drivers directory for these users to have write rights in it
; write list = root, @lpadmin
# add share docs for user
[doc]
comment = User share to net
path = /home/user/doc
public = yes
browseable = yes
guest ok = no
read only = no
writable = yes
create mask = 0777
# You may need to replace 'lpadmin' with the name of the group your
# admin users are members of.
# Please note that you also need to set appropriate Unix permissions
# to the drivers directory for these users to have write rights in it
; write list = root, @lpadmin
# add share docs for user
[doc]
comment = User share to net
path = /home/user/doc
public = yes
browseable = yes
guest ok = no
read only = no
writable = yes
create mask = 0777
sudo /etc/init.d/samba restart