Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dropbear - cannot SSH when user's shell is redirected

Tags:

linux

dropbear

I am running Linux on an embedded system with Buildroot+Dropbear. I am using systemd for init, if that matters.

Logging in via SSH works properly for root, but not as a regular user (gives "Permission denied, please try again."). The user's shell is redirected to a custom program with this entry in /etc/passwd:

admin:x:1000:1000:Custom user:/home/admin:/opt/customCLI

Logging in as the admin user works fine when the shell is /bin/sh. /opt/customCLI is a program I wrote that accepts a minimal set of commands.

Is there a way to support SSH logins directly to a custom program?

like image 418
bjornruffians Avatar asked Jul 28 '26 06:07

bjornruffians


1 Answers

Add your program to /etc/shells

Some login tools will reject logins to users with unknown shells. 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.

like image 82
that other guy Avatar answered Jul 30 '26 00:07

that other guy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!