[SOLVED] What alternatives do I have for running a VERY basic shell at login?
Linux - Embedded & Single-board computerThis forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
What alternatives do I have for running a VERY basic shell at login?
Hi,
I'm building a custom iMX6-based platform, currently using kernel from git.freescale, uboot from denx and rootfs from buildroot. In general, things are working fine. Now I need to have the option to have certain users log in and run a very limited shell. I've written one, but I'm guessing there are alternatives. So, my question is twofold:
1. How can I set the system up so that user 'x' will log in and run something other than the default shell that comes with busybox?
2. I can run my own, but are there other options out there already built for this kind of thing?
1) /etc/passwd specifies the shell that users will log into. You can set it to whatever you want.
2) There are plenty of shell options out there. Reading your post though, there isn't enough info for me to suggest anything for you.
Ok thanks.
Basically I just want something that doesn't give the user any access to the underlying system except through builtins. I've probably got what I need with my own homegrown stuff; but its always good to check with what's out there.
You can accomplish a much more locked down shell by using 'shell of your choice' with chroot environments, and good user/group permissions. That's the way i've set up external user accounts.
Not sure if that is going to work for you or not - if you are willing to code your own shell.
Yea, I'll have to dig into this a bit more.
I've already set up my homegrown shell using adduser (didn't realize it was that simple, thanks!).
I am able to log in at the console as a new user and the shell seems to work fine. Does just what I want... not much! :-)
Next problem...I have dropbear running on my system, and found that when I try to log in as the new user through that interface, I get a message: "Permission denied, please try again".
Not sure what's up with that, so I'll dig.
Thanks much,
Ed
Ok, got it...
Turns out I have to create the file /etc/shells (if not already there), and add the path to my custom shell to that file.
After that I was able to remotely log in and the shell came right up.
Thanks,
Ed
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.