Clickjacking 防範

NGINX 設定

add_header X-Frame-Options "SAMEORIGIN";

參考文章
https://developer.mozilla.org/zh-TW/docs/Web/HTTP/X-Frame-Options
https://geekflare.com/add-x-frame-options-nginx/
http://devco.re/blog/2014/04/08/security-issues-of-http-headers-2-content-security-policy/

SELinux 影響 ssh with key login

如果沒有關閉 SELinux 
ssh 使用 rsa 登入時會遇到錯誤, 
上傳 key 後時要記得更新資料夾權限

restorecon -Rv /folder

就可以正常使用了

[Solve] rsync Argument list too long

因為 UNIX 有限制 ARG_MAX 大小
資料夾底下檔案太多就會出現 Argument list too long

rsync 也一樣, 所以先使用 rsync -n 來跑一次資料夾要同步的檔案, 這裡就不用下星號, 但要注意資料夾 [來源] [目的地] 的位置, 寫錯就會傳錯層級

1. use rsync dry run
rsync -n source/path desc


2. rsync source/path desc


參考文章:
https://hugepang.wordpress.com/2011/06/08/solution-bash-usrlocalbinrsync-argument-list-too-long/


http://blog.xuite.net/jyoutw/xtech/20025390-rsync%E5%8F%83%E6%95%B8%E8%A9%B3%E8%A7%A3--990209

SSH With key login Failure


假如 .ssh, authorized_keys 權限正確, 
但還是無法使用 ssh key 登入
請嘗試在 server 端下以下指令修正資料目錄位置

restorecon -FRvv ~/.ssh

在重新測試是否可順利連結

PHP ldap_bind Can't contact LDAP server


CentOS 7 

vi /etc/openldap/ldap.confg

最後加上

TLS_REQCERT never

然後重啟

nginx, php-fpm

打完收功

FreeBSD mount NAS


# vim /etc/fstab 
# add line
127.0.0.1:/folder /mnt/folder nfs rw 0 0

# mount -a

done~