• 首页
  • 狐文
  • 狐图
  • About
狐窝
OvO
  1. 首页
  2. Linux
  3. 正文

Create htpasswd file for nginx (without apache)

2019年04月21日 236点热度 0人点赞 0条评论
2017-05-07 from--https://coderwall.com/p/zvvgna/create-htpasswd-file-for-nginx-without-apache
apache
nginx
htaccess

If you're like me, and use Nginx instead of Apache, you could eventually face this problem: Create an htpasswd file (for htaccess "authentication").

To create your file, without installing Apache, just run:

$ printf "USER:$(openssl passwd -crypt PASSWORD)\n" >> .htpasswd

Replace USER and PASSWORD for your user and password :)

Written by Boris Quiroz

Recommend

Say Thanks

Update Notifications Off

Respond

2 Responses

Add your response
March 28, 2014 20:20
13764
samba

Hello,

The crypt() function used for this effectively ignores characters beyond 8; you'll see this noted in Apache's documentation as well:
http://httpd.apache.org/docs/2.2/misc/password_encryptions.html

More securely:
$ printf "${username}:`openssl passwd -apr1`\n" >> .htpasswd

This also reads the password from STDIN via openssl, so it doesn't leave traces in shell history.

over 1 year ago ·

April 18, 2014 18:44
14143
jmenchacavr

openssl pssswd -apr1 option is not available on my system. Is there some requirement needed for this? I did a yum install httpd-tools earlier, but this did not show up.

over 1 year ago ·

标签: 暂无
最后更新:2019年04月21日

OvO

狐狸

点赞
< 上一篇
下一篇 >
最新 热点 随机
最新 热点 随机
brave编译打包时dump_syms报错Couldn't locate EXE or DLL file 使用Windows Kits创建PE 及精简镜像 Windows精简部署相关简易内容 APC UPS SUA1000ICH 踩坑记 TrueNAS SCALE虚拟机无法 Ping主机 TrueNas Scale libvirt-sock RDMA RoCE相关资料 Linux系统修改网卡名(eth0-3) Linux系统打开SRIOV 构建android内核时DTC工具中的多个定义错误 Windows 来宾系统提示“安全删除硬件” 修改jar的三种方法(反编译jar) 如何在 Debian 10上安装和配置 VNC Openwrt内SR-IOV网卡桥接问题 Linux下编译android 时报错loadlocale.c:130 windows 查看文件夹被那个进程占用 MongoDB中的多表关联 mongodb 学习记录
Oracle:hint用来手工改变sql的执行计划 CentOS 7 中firewall-cmd命令 mybatis以map为参,动态生成表并插入数据 使用Xorg.conf 修改分辨率 ESXi主机上备份虚拟机 小技巧:让linux程序在后台运行 Oracle中清除BIN$开头的垃圾表的解决办法 用 rar2john+hashcat 破解 RAR 文件密码 MyBatis Plugin 学习使用 /etc/security/limits.conf的相关说明 一条SQL查询语句的问题 vmware的硬件选项里有关于虚拟化引擎的选项 Anaconda之conda常用命令介绍 Comparison of proxifiers | 代理工具对比 租房注意事项 Windows下GitBook的安装详解 linux CPU压力测试脚本 UDPSpeeder为UDP加速 (udp2raw-tunnel)
标签聚合
下载 文件 https com http ssl 网卡 linux 密码 android e 编译 chrome 路由 docker git

COPYRIGHT © 2020 狐窝. ALL RIGHTS RESERVED.

THEME KRATOS MADE BY VTROIS