zoukankan      html  css  js  c++  java
  • CentOS7.5装机必备

    C7.5修改主机名

    /etc/hostname

     

    Chkcofig中只有两个服务

    C7.5的服务管理是systemctl

    启动systemctl start

    关闭systemctl stop

    Systemctl disable 关闭服务的开机自启动

    Systemctl enable 开启服务的开机自启动

    C7.5的防火墙不叫iptables

    systemctl stop firewalld关闭防火墙

    systemtcl disable firewalld 关闭防火墙开机自启

    systemtcl stop NetworkManager

    systemctl disable NetworkManager

     

    /etc/rc.d/rc.local默认是没有执行权限的,需要手动加755权限

     

    需要开机装的:

     

     

    Vim /etc/ssh/sshd—config{,.bak}

    17行 修改到1w以上即可

    38行 是否开启超级用户远程登录,工作中使用普通用户登录

    47行 秘钥文件路径

    65行 是否开启密码验证

    79行 no

    115行 no

     

    /etc/ansible/hosts

    [nginx]

    Web01 ansible_ssh_host=192.168.200.127

    Web02 ansible_ssh_host=192.168.200.128 ansible_ssh_passwd=308926

     

     

     

    Ansible Web01 -m ping 查看与下属服务器的连接情况

    Ansible web01 -m shell -a

    Ansible all -m shell -a ‘crontab -l’ 查看定时任务

    Ansible all -m copy -a ‘src=/mnt/test222 dest=/mnt/’

    (src是源,dest是目标)

    Ansible all -m copy -a ‘src=/mnt/test222 dest=/mnt/’ backup=yes(遇到同名文件时做备份)

    Ansible Web02 -m shell -a ‘chmod +x /mnt/test’

    远程给文件加权限

    Ansible Web02 -m shell -a ‘/mnt/test’

    远程执行脚本

    Ansible all -m script -a ‘/mnt/test.sh’

    远程执行脚本,但不在对方电脑上留下任何信息

  • 相关阅读:
    WPF可视对象变换(RenderTransform)-----RotateTransform、TranslateTransform、ScaleTransform
    WPF 基本图形
    C#创建DataTable
    WPFの触发器详解
    WPF绑定のRelativeSource
    287. Find the Duplicate Number
    238. Product of Array Except Self
    127. Word Ladder
    674. Longest Continuous Increasing Subsequence
    621. Task Scheduler
  • 原文地址:https://www.cnblogs.com/Lassiter/p/9951105.html
Copyright © 2011-2022 走看看