基于安全性考虑,将服务器进行最小化安装,毕竟软件包越少,漏洞越少,相对来说就约安全,但是最小化安装会给运维带来一些问题和不便,下面是我总结的,常见的一些配置和工具的安装,仅供各位大神参考,如有新的idea,欢迎补充!

 #yum配置
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
CentOS
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
CentOS
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all
yum makecache #时间同步
echo "*/5 * * * * /usr/sbin/ntpdate ntp.sjtu.edu.cn >> /home/timedate.log && hwclock -w && hwclock --show >> /home/timedate.log" >> /var/spool/cron/root #ctrlaltdel
sed -i '/ca::ctrlaltdel:/{s/^/#/}' /etc/inittab #initdefault
sed -r -i '/^id/s/.*/id:3:initdefault:/' /etc/inittab #lock file
chattr +i /etc/passwd /etc/inittab /etc/group /etc/shadow /etc/gshadow
mv /usr/bin/chattr /usr/bin/testchattr #常用工具安装:
yum -y install wget vim lsof lrzsz # GCC编译环境
yum -y install gcc-* zlib zlib-devel glibc-* libpcap libpcap-devel ncurses ncurses-devel libpcap-devel* unzip # 系统管理常用工具
yum -y install sysstate iotop state dstat htop iotop #性能监控工具
dstat iftop htop sysstat # setup命令
yum install setuptool ntsysv system-config-network-tui system-config-securitylevel-tui iptables -y #其他工具安装
yum -y install rsync git vsftpd httpd #桌面环境-右键没有terminal
yum -y install nautilus-open-terminal
reboot
shutdown -r now # 防火墙
iptables -F
service iptables save
service iptables restart
chkconfig iptables off #selinux
setenforce
sed -r -i '/^SELINUX=/s/.*/SELINUX=disabled/' /etc/selinux/config #history
echo "HISTFILESIZE=2000" >> /etc/bashrc
echo "HISTFILESIZE=2000" >> /etc/bashrc
echo "HISTSIZE=2000" >> /etc/bashrc
echo "HISTTIMEFORMAT='<%F %T> : '" >> /etc/bashrc #timeout ssh
echo "umask 022" >>/etc/profile
echo "export TMOUT=6000" >>/etc/profile #open files
echo "* soft nofile 65535" >> /etc/security/limits.conf
echo "* hard nofile 65535" >> /etc/security/limits.conf
echo "* - nproc unlimited" >> /etc/security/limits.conf
echo "* soft nproc unlimited" >>/etc/security/limits.d/-nproc.conf
echo "session required /lib64/security/pam_limits.so" >>/etc/pam.d/login

最小化安装Linux的常用配置整理的更多相关文章

  1. Linux 最小化安装后IP的配置(手动获取静态IP地址)

    一.图形化界面配置(假设为电脑A) 如果你的Linux安装有图形化界面,那么通过以下方式来配置: 我这里是有两块网卡,第一个网卡在上篇中已经通过DHCP来配置了:Linux 最小化安装后IP的配置(D ...

  2. Linux 最小化安装后IP的配置(DHCP获取IP地址)

    图形化Linux的DHCP好配置,我就不讲了.主要将一下Linux最小化安装后IP的配置: linux最小化安装后没有ifconfig这个命令: yum install net-tools.x86_6 ...

  3. Linux学习笔记之Linux最小化安装启动后如何配置

    在VM虚拟机中安装CentOS 7 时 有时候顾虑到电脑硬件性能,我们需要最小化安装,而最小化安装后与centos6的版本是有一些差异的,接下来我们就对刚安装好的最小化centos7做一些操作,来世我 ...

  4. ArchLinux最小化安装 必备库 常用命令

    铸成强大的工作站环境——ArchLinux最小化安装 所有问题归结起来,只是一个问题:ArchLinux最小化安装,需要安装哪些包? 1.bash//最基本的Bash Shell(必须)2.bzip2 ...

  5. 最小化安装linux CentOS_7操作系统

    实验环境为VMware虚拟机安装操作系统. 1.打开VMware Workstation 虚拟机,选择创建新的虚拟机: 2.选择linux-CentOS 64位操作系统: 3.为虚拟机命名,并选择安装 ...

  6. 最小化安装Linux记录

    挂载点: /boot 挂载点  100M swap 交换分区 / 根分区 最小化安装: 基本--基本.兼容库.调试工具 开发--开发工具 修改hostname 永久设置:/etc/sysconfig/ ...

  7. Vm虚拟机最小化安装linux并配置NAT网络连接(全图)

  8. 最小化安装linux CentOS-6.6后 部署fastdfs +下载地址 很干很干的干货

    参考:http://blog.itpub.net/7734666/viewspace-1292485/ 安装一些必要软件 yum -y install wget gcc perl mkdir ~/zy ...

  9. CentOS 7 最小化安装的无线网络配置

    1.首先下载iw工具. yum -y install iw 2.获取无线网卡的名称 执行iw dev,假设获得名称为 wlp3s0(示例) 3.激活无线网络接口 执行ip link set wlp3s ...

随机推荐

  1. Uva 12169 不爽的裁判 模运算

    题目链接:https://vjudge.net/contest/156903#problem/B 题意: 有一个递推公式 : a,b都不是已知的,给出了 x1,x3,x5.... 求x2,x4,x6. ...

  2. 如何将Win7做为NTP服务器

    1. 修改注册表项    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer   ...

  3. lasagne保存网络参数

    # Optionally, you could now dump the network weights to a file like this: # np.savez('model.npz', *l ...

  4. ajax实现无刷新两级联动DropDownList

    ajax实现的无刷新三级联动 http://zhangyu028.cnblogs.com/articles/310568.html 本文来自小山blog:http://singlepine.cnblo ...

  5. swiper轮播始终居中active图片

    用的是vue-awesome-swiper 在vue项目中,参数方法与swiper一致.使用场景如下: 左侧小图一共八张,默认显示的是三张,始终保持activeimg在中间,提升用户体验度.swipe ...

  6. [JZOJ] 5905. 黑暗之魂(darksoul)

    基环树直径裸题 分别在子树做DP,环上做DP,环上可以用单调队列优化到\(O(n)\) 写起来很麻烦 #include<algorithm> #include<iostream> ...

  7. Java基础-方法区以及static的内存分配图

    转载自: https://blog.csdn.net/Wang_1997/article/details/52267688 前面的几篇都没有太明确地指出 方法区 是什么?现在通过一些资料的收集和学习, ...

  8. js点击获取标签里面id属性

    <html xmlns="http://www.w3.org/1999/xhtml"> <head > <title></title> ...

  9. Linux Kernel ---- PCI Driver 分析

    自己笔记使用. Kernel 版本 4.15.0 (ubuntu 18.04,intel skylake) 最近想学习VGA驱动去了解 DDCCP / EDID 等协议,然后顺便了解下驱动是如何工作的 ...

  10. SSH & 文件传输 & 远程桌面管理

    SSH   Windows Linux MacOS Android IOS                                     https://www.ssh.com http:/ ...