linux一些常用操作

1.开启ssh服务:

vim /etc/ssh/sshd_config

#port 22

把#去掉

2.关掉防火墙:

  1. 临时关闭,即时生效,重启失效

    # 关闭防火墙
    $ service iptables stop
    
    # 开启防火墙
    $ service iptables start
    
  2. 永久关闭,重启生效

    # 关闭防火墙
    $ chkconfig iptables off
    
    # 开启防火墙
    $ chkconfig iptables on

编辑防火墙配置文件:

vim /etc/sysconfig/iptables 

3.修改配置主机名:

vim /etc/hosts

4.添加开启启动:

vim /etc/rc.d/rc.local

5.配置环境变量:

vim /etc/profile

使环境变量生效:source /etc/profile

猜你喜欢

转载自blog.csdn.net/zxz547388910/article/details/70262316