自动补全

  1. yum install bash-completion -y #安装
  2. bash #重新进入shell即可开启

免密登录

  1. [usera@serverA ~]$ ssh-keygen -t rsa
  2. Generating public/private rsa key pair.
  3. Enter file in which to save the key (/home/usera/.ssh/id_rsa):
  4. Created directory '/home/usera/.ssh'.
  5. Enter passphrase (empty for no passphrase):
  6. Enter same passphrase again:
  7. Your identification has been saved in /home/usera/.ssh/id_rsa.
  8. Your public key has been saved in /home/usera/.ssh/id_rsa.pub.
  9. The key fingerprint is:
  10. 39:f2:fc:70:ef:e9:bd:05:40:6e:64:b0:99:56:6e:01 usera@serverA
  11. The key's randomart image is:
  12. +--[ RSA 2048]----+
  13. | Eo* |
  14. | @ . |
  15. | = * |
  16. | o o . |
  17. | . S . |
  18. | + . . |
  19. | + . .|
  20. | + . o . |
  21. | .o= o. |
  22. +-----------------+
  23. [usera@serverA ~]$ ssh-copy-id user@ip

chrony时间服务器

  1. server cn.ntp.org.cn iburst
  2. server ntp1.aliyun.com iburst
  3. server ntp1.aliyun.com iburst
  4. server 3.centos.pool.ntp.org iburst

五、Kali Linux国内软件源

  1. #中科大
  2. deb http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib
  3. deb-src http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib
  4. deb http://mirrors.ustc.edu.cn/kali kali-rolling main contrib non-free
  5. #阿里云
  6. deb http://mirrors.aliyun.com/kali kali-rolling main non-free contrib
  7. deb-src http://mirrors.aliyun.com/kali kali-rolling main non-free contrib
  8. #清华大学
  9. #deb http://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free
  10. #deb-src https://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free
  11. #浙大
  12. #deb http://mirrors.zju.edu.cn/kali kali-rolling main contrib non-free
  13. #deb-src http://mirrors.zju.edu.cn/kali kali-rolling main contrib non-free
  14. #东软大学
  15. #deb http://mirrors.neusoft.edu.cn/kali kali-rolling/main non-free contrib
  16. #deb-src http://mirrors.neusoft.edu.cn/kali kali-rolling/main non-free contrib
  17. #官方源
  18. #deb http://http.kali.org/kali kali-rolling main non-free contrib
  19. #deb-src http://http.kali.org/kali kali-rolling main non-free contrib
  20. #重庆大学
  21. #deb http://http.kali.org/kali kali-rolling main non-free contrib
  22. #deb-src http://http.kali.org/kali kali-rolling main non-free contrib

强制安装

  1. rpm -ivh --replacefiles --force --nodeps *.rpm

shell脚本常用变量

  1. $# 是传给脚本的参数个数
  2. $0 是脚本本身的名字
  3. $1 是传递给该shell脚本的第一个参数
  4. $2 是传递给该shell脚本的第二个参数
  5. $@ 是传给脚本的所有参数的列表
  6. $* 是以一个单字符串显示所有向脚本传递的参数,与位置变量不同,参数可超过9
  7. $$ 是脚本运行的当前进程ID
  8. $? 是显示最后命令的退出状态,0表示没有错误,其他表示有错误