Thursday, October 18, 2012

Linux / UNIX generate htpasswd to store username and password with htpasswd command

http://www.cyberciti.biz/faq/create-update-user-authentication-files/

Create a new password file
  • Following command will creates a new file and stores a record in it for user jerry. The user is prompted for the password. If the file exists and cannot be read, or cannot be written, it is not altered and htpasswd will display a message and return an error status.
# htpasswd -c /home/pwww/.htpasswd jerry
  • สร้างไฟล์ชื่อ /home/pwww/.htpasswd และเพิ่ม user ชื่อ jerry เข้าไป เมื่อเรากด enter จะมี prompt ให้เราใส่รหัสของ jerry

Change or update password
  • To add or modifies the password for user tom, enter:
# htpasswd /home/pwww/.htpasswd-users tom
  • เปลี่ยนรหัสของ tom ซึ่งอยู่ในไฟล์ /home/pwww/.htpasswd 

No comments:

Post a Comment

Popular Posts