3.26.2014

[Git] Git Learn with tryGit

Try Git
http://try.github.io

@本機端初始化
  git config --global user.name "TestMan"
  git config --global user.email "TestMan@mail.com"

@從Github抓檔案下來
  git clone https://github.com/TestMan/TestMan.git

@Create a new repository on the command line/
  touch README
  git init
  git status
  git add README
  git commit -m "first commit"
  git remote add origin https://github.com/XXX/XXX
  git push -u origin master

@Push an existing repository from the command line/
  git remote add origin https://github.com/XXX/XXX
  git push -u origin master

Reference:

3.25.2014

[Linux] RHEL/CentOS 安全設定


~SSH 設定  
  • #vi /etc/ssh/sshd_config 
    • Disable root ssh: PermitRootLogin no
    • 閒置300秒斷線: 
      • ClientAliveInterval 300
      • ClientAliveCountMax 0
  • ※vi /etc/profile:
    •  TMOUT 2700; export TMOUT
    • 登入失敗三次即斷線:MaxAuthTries 3
  • vi /etc/hosts.allow : sshd:172.18.1.1
  • vi /etc/hosts.deny :  sshd:ALL
  • 重啟  #service sshd restart

~密
碼管理
  • 帳戶密碼最大使用期限不可超過90天、最小使用期限不可超過60天、密碼最小長度12、密碼到期30天前提醒:
    • vi /etc/login.defs #
    • PASS_MAX_DAYS 90
    • PASS_MIN_DAYS 60
    • PASS_MIN_LEN 12
    • PASS_WARN_AGE 30
  • 帳號使用之密碼滿90天需強迫變更,到期前30天提醒:
    • chage -M 90 -W 30 account
  • 將帳號的最後變更密碼日期改成今天:
    • chage -d yyyy-mm-dd account
  • 設定密碼複雜度(最少為8碼)
    • /etc/pam.d/system-auth
    • password requisite pam_cracklib.so try_first_pass retry=3 dcredit=1 ucredit=1 ocredit=1 lcredit=1 minlen=8
    • password sufficient pam_unix.so md5 shadow nullok try_first_pass use_authok remember=3
    • password required pam_deny.so