linux常用装机命令

防火墙:
systemctl stop firewalld
systemctl disable firewalld
systemctl list-unit-files | grep firewalld

ftp服务
启动ftp和开机自启动命令
/bin/systemctl start  vsftpd.service
systemctl enable vsftpd.service
ps -ef |grep ftp
systemctl list-unit-files|grep vsftpd

查看ssh开机自启动
systemctl enable sshd
systemctl list-unit-files | grep ssh

查看ntp是否开机自启动
systemctl status ntpd
systemctl list-unit-files |grep ntpd

安装telnet
rpm -qa|grep telnet;
yum -y install telnet-server;
systemctl start telnet.socket;
systemctl list-unit-files |grep telnet

创建用户
groupadd A
useradd -d /home/nmb -m -g nmc -s /bin/bash hanjf
chown hanjf:A /home/nmcuser
echo xX9#a13Js85kd0Ayi2 | passwd hanjf --stdin

-d指定用户主目录路径
-m如果路径不存在,将自动创建
-s指定默认shell


java环境变量
#java environment
export JAVA_HOME=/usr/local/jdk1.8.0_111
export CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar
export PATH=$PATH:${JAVA_HOME}/bin

最大文件打开数
* soft nofile 65535   
* hard nofile 65535  
echo "* soft nofile 65535"  >> /etc/security/limits.conf
echo "* hard nofile 65535"  >> /etc/security/limits.conf

* soft noproc 11000
* hard noproc 11000

* 代表针对所有用户
noproc 是代表最大进程数
nofile 是代表最大文件打开数

环境变量
历史记录配置
export HISTTIMEFORMAT="%F %T `whoami`     #给history加上时间戳
echo 'export HISTTIMEFORMAT="%F %T `whoami` "' >> /etc/profile
系统空闲等待时长
export TMOUT=300

  

转载于:https://www.cnblogs.com/hanjianfei/p/11454651.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值