I customized my BusyBox to include some specific applets. Now I want a user login to BusyBox as its shell. I mean when that when user enters its username and passwords, he will bed redirected to an environment that only my desired applets are usable. Changing login shell of the user using following command does not work:
usermod -s /bin/busybox MYUSERusing su MYUSER only shows BusyBox help but I need an interactive shell includes only my desired applets. Any solution?
2 Answers
busybox command isn't an interactive shell. As Thomas said, you should run busybox sh for its interactive shell. Use these commands to set busybox interactive shell as login shell of user MYUSER:
echo "/bin/busybox sh" > /bin/ibusybox
chmod +x /bin/ibusybox
usermod -s /bin/ibusybox MYUSERAlso using ibusybox will run busybox interactive shell.
You would have to start busybox with sh as parameter. Best would be to write a little wrapper:
mkdir -p /usr/local/share/busybox
echo "/bin/busybox sh" > /usr/local/share/busybox/sh
chmod +x /usr/local/share/busybox/shThen test the login:
su - -s /usr/local/share/busybox/sh woodIf successful you can add /usr/local/share/busybox/sh as the user's shell.
usermod -s /usr/local/share/busybox/sh MYUSERI quickly tried to symlink busybox to /usr/local/share/busybox/sh but that did not work. So therefore the wrapper script.