[英]Dropbear - cannot SSH when user's shell is redirected
I am running Linux on an embedded system with Buildroot+Dropbear. 我在带有Buildroot + Dropbear的嵌入式系统上运行Linux。 I am using systemd for init, if that matters. 如果这很重要,我正在使用systemd进行初始化。
Logging in via SSH works properly for root, but not as a regular user (gives "Permission denied, please try again."). 对于root用户,通过SSH可以正常登录,但不能作为普通用户登录(给出“权限被拒绝,请重试。”)。 The user's shell is redirected to a custom program with this entry in /etc/passwd: 使用/ etc / passwd中的该条目将用户的Shell重定向到自定义程序:
admin:x:1000:1000:Custom user:/home/admin:/opt/customCLI
Logging in as the admin
user works fine when the shell is /bin/sh
. 当外壳为/bin/sh
时,以admin
用户身份登录可以正常工作。 /opt/customCLI
is a program I wrote that accepts a minimal set of commands. /opt/customCLI
是我编写的程序,它接受最少的命令集。
Is there a way to support SSH logins directly to a custom program? 有没有一种方法可以直接支持SSH登录到自定义程序?
Add your program to /etc/shells
将程序添加到/etc/shells
Some login tools will reject logins to users with unknown shells. 某些登录工具将拒绝具有未知Shell的用户登录。 This prevents the back door of using SSH to modify files or forward ports while being locked out with /usr/sbin/nologin
or /bin/false
. 这样可以防止在使用/usr/sbin/nologin
或/bin/false
锁定时使用SSH修改文件或转发端口的后门。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.