Trong file cấu hình host thêm vào :
Nếu muốn bảo mật thêm về IP truy cập thì thêm vào block location :
thay tên thư mục chứa file htpasswd mà bạn thích
Tạo mật khẩu trong ssh:
với salt hash là chuỗi mã hóa pass, thêm nội dung user và pass vào file htpasswd theo định dạng:
vd:
Khởi động lại Nginx
Mã:
location ~ ^/(data|templates|internal_data|library|src|install)/(.*)$ { internal; }
location /admin.php { auth_basic "Administrator Login"; auth_basic_user_file /etc/nginx/htpasswd; index index.html index.htm; }
Mã:
allow 127.0.0.1;
allow YOURIPADDRESS;
deny all;
Tạo mật khẩu trong ssh:
Mã:
perl -le 'print crypt("mat_khau_cua_ban_khong_co_khoang_trang", "salt-hash")'
Mã:
username:salt-hash:comment
Mã:
XenForo:saaeo0gU5Z1m.:XenForo