0

I'm trying to telnet to an embedded Linux based device and I'm able to log in successfully using the root credentials. However, I'm not able to run many bash commands.

Commands like mv, cp, cd, ls, etc. are working, but commands like uname, df, install, etc. (even commands required for POSIX compliance!) don't seem to work. Can't seem to figure out what I'm missing.

# install 
-sh: install: not found
# uname -1
-sh: uname: not found
# ls
bin    etc    lib    opt    sbin   tmp    utils
dev    home   mnt    proc   sys    usr    var
Zaxter
  • 2,939
  • 3
  • 31
  • 48
  • 2
    What system are you exactly connecting to? Who promised you that these commands would be available? – reto Jun 11 '14 at 12:32
  • "bash commands"? neither install nor uname are bash commands, in the sense of built-in. they are executables in a directory of your file system. are you sure you have bash at all? echo $SHELL could tell. "Can't seem to figure out what I'm missing" - those commands you're trying, most probably. see what ls -l $(which ls) shows, whether it symlinks to something called "busybox" – Deleted User Jun 11 '14 at 12:50
  • It's an embedded linux Door phone device. I thought in order to be POSIX compliant these commands should be available. – Zaxter Jun 11 '14 at 13:00
  • # echo $SHELL /bin/sh – Zaxter Jun 11 '14 at 13:02
  • 1
    Side-note: Its actually a tedious task to add any command in embedded linux, you will always find comman which are absolute requirement, because of three reasons, you shall have to compile them and add to OS and you don't have a hard-drive on embedded devices its a limited flash which you have got. Also OS is loaded into RAM from flash and it should not take forever to load and start, as processing is also limited. – PradyJord Jun 11 '14 at 13:13

1 Answers1

5

Usage of Busybox as shell interpreter is very common in embedded world. It's an ash interpreter that can be compiled with minimum functionality.

  1. Try to determine shell interpreter you have on your system using this tips: How to determine the current shell I'm working on?

  2. You can "ls /usr/bin" and "ls /usr/sbin" to see what commands are physically available.

Community
  • 1
  • 1
incogn1to
  • 429
  • 4
  • 17
  • Thanks for reply. I did find busybox in /bin/busybox. – Zaxter Jun 11 '14 at 13:06
  • You have already verified that it is `busybox`. It is sometimes possible that the implementation is available in `busybox` binary (for some simple commands), but the corresponding sym-link is missing. Not a great tip, but try `ln -s /bin/busybox /sbin/`. If your `busybox` has implementation for that command, it _may_ work for that command. – anishsane Jun 11 '14 at 14:06
  • 1
    To get the complete list of commands implemented by your build of busybox, simply type "busybox" at the shell prompt. If there is no symbolic link for a command, then simply type "busyboc ...", i.e. use "busybox" as a command prefix just like "sudo ...". – sawdust Jun 11 '14 at 18:11