python - 如何使用命令或python在OpenWrt中添加用户?

标签 python ubuntu network-programming router openwrt

根据此链接https://vladimir-ivanov.net/create-user-without-useradd-command-openwrt/我完成了所有步骤,但我没有在 OpenWrt /etc/passwd file contains the encrypted password, that should be in /etc/shadow 中添加任何用户。我编辑用户并将其添加到/etc/passwd 中,然后使用“passwd testuser”命令。它要求我设置两次密码并将加密的密码添加到/etc/passwd.conf 文件中。但它没有添加用户或向/etc/shadow 写入任何内容。我在 Ubuntu 中做了同样的事情并且成功了。但我需要在 OpenWrt 中进行。

最佳答案

您应该安装 shadow-useradd 软件包:

opkg update
opkg install shadow-useradd

文档:Secure your router's access

关于python - 如何使用命令或python在OpenWrt中添加用户?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50060219/

相关文章:

ubuntu - ssh 不读取 ssh 配置

mysql - 在 Ubuntu 64 位上构建 lib_mysqludf_sys - 配置问题

c - 使用 C 在套接字编程中创建数据包以及发送和接收数据包的正确方法

c++ - 如何解决此阻塞问题?

python - 在启动时运行的 bash 脚本中激活 conda 环境

python - 有没有办法在 Python 中运行 selenium 时隐藏浏览器?

python - 容器内 conda 的目的是什么?

Linux:我的符号链接(symbolic link)损坏了

mobile - 移动应用程序使用什么网络端口

python - 自定义 Seaborn Barplot 中使用的 'Hue' 颜色