admin
不忘初心,方得始终
级别: 管理员
只看楼主 | | | 0楼 发表于:2017-02-23 18:36

服务器OpenSuse系统配置Openstack 镜像

1.关闭防火墙
SuSEfierwall2 stop
chkconfig SuSEfierwall2 off
2.开启密码认证:
vim /etc/ssh/sshd_config:
PermitRootLogin yes
PasswordAuthentication yes
3.配置IP、DNS、网关:
vim /etc/sysconfig/network/ifcfg-eth0:
BOOTPROTO='static'
BROADCAST=''
ETHTOOL_OPTIONS=''
IPADDR='192.168.3.121'
MTU=''
NAME=''
NETMASK='255.255.240.0'
NETWORK=''
REMOTE_IPADDR=''
STARTMODE='auto'
DHCLIENT_SET_DEFAULT_ROUTE='yes'

vim /etc/resolv.conf:
### /etc/resolv.conf file autogenerated by netconfig!
#
# Before you change this file manually, consider to define the
# static DNS configuration using the following variables in the
# /etc/sysconfig/network/config file:
#     NETCONFIG_DNS_STATIC_SEARCHLIST
#     NETCONFIG_DNS_STATIC_SERVERS
#     NETCONFIG_DNS_FORWARDER
# or disable DNS configuration updates via netconfig by setting:
#     NETCONFIG_DNS_POLICY=''
#
# See also the netconfig(8) manual page and other documentation.
#
# Note: Manual change of this file disables netconfig too, but
# may get lost when this file contains comments or empty lines
# only, the netconfig settings are same with settings in this
# file and in case of a "netconfig update -f" call.
#
### Please remove (at least) this line when you modify the file!
search local
nameserver 114.114.114.114
nameserver 202.106.0.20

cp /usr/share/doc/packages/wicked/samples/suse/host1/routes /etc/sysconfig/network/routes
vim  /etc/sysconfig/network/routes:
default 192.168.0.1
4.配置时钟同步
zypper in ntp
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
ntpdate cn.pool.ntp.org
crontab -e:
* */6 * * * /usr/sbin/ntpdate cn.pool.ntp.org | logger -t NTP
systemctl enable cron
systemctl restart cron
5.关闭图形化界面:
systemctl set-default multi-user.target
6.安装cloud-init软件
zypper in cloud-init
7.ssh 功能开启:
vim /etc/cloud/cloud.cfg:
disable_root: false
ssh_pwauth: true
8.开启主机名修改权限:
vim /etc/cloud/cloud.cfg:
删除掉 -  update_hostname
9.配置软件源:
cd /etc/zypp/repos.d
新增软件源的配置文件放在这个路径下。
10.添加DNS解析权限:
vim /etc/cloud/cloud.cfg:
在cloud_init_modules下面添加:
- resolv-conf
11.修改网卡配置:
vim /etc/sysconfig/network/config:
添加 NOZEROCONF="yes"