1.改主机名: sed -i 's#HOSTNAME=.*#HOSTNAME=u05mix06.yaya.corp#g' /etc/sysconfig/network && hostname u05mix06.yaya.corp sed -i 's#HOSTNAME=.*#HOSTNAME=u04es01' /etc/sysconfig/network && hostname u04es01 2.修改服务器ssh端口 ucloud: sed -i 's/#Port 22/Port 28290/' /etc/ssh/sshd_config sed -i 's/^GSSAPIAuthentication yes$/GSSAPIAuthentication no/' /etc/ssh/sshd_config service sshd restart aliyun: sed -i 's/#Port 22/Port 38390/' /etc/ssh/sshd_config sed -i 's/^GSSAPIAuthentication yes$/GSSAPIAuthentication no/' /etc/ssh/sshd_config service sshd restart test: sed -i 's/#Port 22/Port 48490/' /etc/ssh/sshd_config sed -i 's/^GSSAPIAuthentication yes$/GSSAPIAuthentication no/' /etc/ssh/sshd_config service sshd restart 修改root密码: echo 'pass'|passwd --stdin root 3.添加chinasoft用户 uclod mkdir -p /data/chinasoft useradd chinasoft -d /data/chinasoft aliyun useradd chinasoft -d /home/chinasoft # 配置密码 echo 'pass'|passwd --stdin chinasoft cp /etc/skel/{.bash_profile,.bashrc,.bash_logout} /data/chinasoft cp /etc/skel/{.bash_profile,.bashrc,.bash_logout} /home/chinasoft chown -R chinasoft.chinasoft /data # 验证 su - chinasoft 验证端口,密码是否修改ok 是否添加sudo权限 visudo chinasoft ALL=(ALL) NOPASSWD: ALL 4.安装jdk1.8_102 将jdk-8u102-linux-x64.rpm上传到对应的服务器上 具体步骤: 检查现有版本JDK # java -version 查找java相关文件并卸载 # rpm -qa|grep -i java tzdata-java-2016f-1.el6.noarch java-1.8.0-openjdk-headless-1.8.0.101-3.b13.el6_8.x86_64 卸载openjdk1.8 rpm -e --nodeps java-1.8.0-openjdk-headless-1.8.0.101-3.b13.el7_2.x86_64 rpm -e --nodeps tzdata-java-2016f-1.el7.noarch rpm -e --nodeps java-1.8.0-openjdk-1.8.0.101-3.b13.el7_2.x86_64 scp -P 28290 -r /usr/lib/rpm/ u04dnsmgr02.yaya.corp:/usr/lib/rpm/ 安装jdk8 rpm -ivh jdk-8u102-linux-x64.rpm java环境所在目录: /usr/java/jdk1.8.0_102/ /usr/java/jdk1.8.0_102/bin/java JAVA_HOME=/usr/java/jdk1.8.0_102/ JRE_HOME=/usr/java/jdk1.8.0_102/jre PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib export JAVA_HOME JRE_HOME PATH CLASSPATH vim /etc/profile export JAVA_HOME=/usr/java/jdk1.
centos系统初始化配置
最新推荐文章于 2024-07-17 09:53:22 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)