新服配置(1)

新服务器配置列表

网络:

使用静态 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

自动更新固定 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

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

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

 sudo /etc/init.d/samba  restart

转载于:https://my.oschina.net/jingxia/blog/697571

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值