加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux常用装机命令

发布时间:2020-12-14 00:42:26 所属栏目:Linux 来源:网络整理
导读:防火墙:systemctl stop firewalldsystemctl disable firewalldsystemctl list-unit-files | grep firewalldftp服务启动ftp和开机自启动命令/bin/systemctl start vsftpd.servicesystemctl enable vsftpd.serviceps -ef |grep ftpsystemctl list-unit-files|
防火墙:
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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读