zoukankan      html  css  js  c++  java
  • linux命令备忘

    yum info softname 查看安装包信息

    yum install softname 安装包名

    安装 nginx http://jingyan.baidu.com/article/aa6a2c14dc36640d4d19c47e.html

    uname -r 查看系统内核

    cat /etc/centos-release 查看系统版本

    ulimit -n 查看文件限制

    rz -bey 上传

    sz /path/filename 下载

    rm -rf 强制删除

    mv xx xx 移动/重命名

    tar -zxvf xxx 解压 

    tar -zcvf x.tar.gz 目录  压缩

    timedatectl  查看时间配置

    timedatectl set-timezone Asia/Shanghai

    localectl

    localectl set-locale LANG=zh_CN.utf8

    gitlab 安装:https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ce/

    ---------------------

    2017-4-11更新

    cenos 安全性设置:

    1、添加一个新用户(不建议用root操作)

    useradd example_user && passwd example_user

    然后 输入2次密码即可

    2、将用户添加到wheel组(这个组可以使用sudo权限)

    usermod -aG wheel example_user

    3、关闭root用户登录

    vim /etc/ssh/sshd_config
    修改 PermitRootLogin no

    4、使用sslkeyfile登录(新手不建议折腾)

    1、使用你新建的用户登录服务器端 
       mkdir ~/.ssh; nano ~/.ssh/authorized_keys
    2、将本地id_rsa.pub的文件写入 authorized_keys中
    3、修改权限 
      sudo chmod 700 -R ~/.ssh && chmod 600 ~/.ssh/authorized_keys
    4、修改/etc/ssh/sshd_config中的PasswordAuthentication 
       PasswordAuthentication no
    5、重启sshd
        sudo systemctl restart sshd

    5、开启防火墙

    暂时跳过

  • 相关阅读:
    NPTL 线程同步方式
    mysql事物处理
    DHCP服务器-DNS服务器-Samba服务器
    NTP服务器
    wsgiref 源代码分析
    集群负载均衡LVS
    百万数据查询优化技巧三十则
    Shell 基本运算符
    Shell 数组
    Shell 传递参数
  • 原文地址:https://www.cnblogs.com/rufus-hua/p/4995958.html
Copyright © 2011-2022 走看看