LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This 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


Reply
  Search this Thread
Old 02-27-2014, 12:05 PM   #1
elsutjr
LQ Newbie
 
Registered: Feb 2014
Posts: 18

Rep: Reputation: Disabled
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?

Thanks in advance,
Ed
 
Old 02-27-2014, 12:13 PM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693
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.
 
1 members found this post helpful.
Old 02-27-2014, 12:22 PM   #3
elsutjr
LQ Newbie
 
Registered: Feb 2014
Posts: 18

Original Poster
Rep: Reputation: Disabled
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.
 
Old 02-27-2014, 12:37 PM   #4
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693
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.

Hope it helps anyway.
 
1 members found this post helpful.
Old 02-27-2014, 12:47 PM   #5
elsutjr
LQ Newbie
 
Registered: Feb 2014
Posts: 18

Original Poster
Rep: Reputation: Disabled
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
 
Old 02-27-2014, 02:18 PM   #6
elsutjr
LQ Newbie
 
Registered: Feb 2014
Posts: 18

Original Poster
Rep: Reputation: Disabled
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash script not running on shell login. uncle-c Linux - Newbie 8 02-21-2009 10:41 AM
Basic Shell problems running commands. anon276 Programming 5 02-12-2007 05:44 AM
Alternatives to programming with Visual Basic ?? Kevin Tough Programming 4 05-02-2006 09:25 PM
You aren't running in a login shell. ? Odd error esears Linux - Software 1 05-20-2004 04:00 PM
login - alternatives under RH 8? kprocter Linux - Software 3 06-04-2003 11:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 04:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration