0

Does anyone know the reason for Alpine Linux choosing sh over bash?

Is it more secure, smaller in size or both? Or is it inherited from busybox?

I assume bash is the more widely known interface.

5
  • wiki.alpinelinux.org/wiki/…
    – muru
    Jun 9, 2020 at 3:17
  • @muru that link explains how to install bash to mimic other systems. Not why shell was chosen in the first place.
    – Lex
    Jun 9, 2020 at 3:22
  • 2
    "As explain in Alpine Linux:Overview, the system always will be minimalist"
    – muru
    Jun 9, 2020 at 3:23
  • @muru can you expand on why shell is more minimal than bash?
    – Lex
    Jun 9, 2020 at 3:27
  • 6
    If you're getting sh for free from busybox anyway, having another shell installed is decidedly not minimal. Also, less features => less code, more minimal.
    – muru
    Jun 9, 2020 at 3:33

1 Answer 1

8

/bin/sh is a symlink to busybox ash.

The reason why busybox has been choosed is explained here

"Alpine Linux is a security-oriented, lightweight Linux distribution based on musl libc and Busybox."

It's a design choice. Alpine has been designed to be minimalist and to run in embedded system. Also with less (and smaller in size) software, the attack surface is minimal. If this sounds new, it is not, because this was the original goal of Alpine.

In this case, internet machine archive can help.

The main page at that time explained:

"Alpine is a modular embedded linux distribution for use in small appliances such as routers, VPN gateways, and more. The name "Alpine" stands for A Linux Powered Integrated Network Engine."

So, the simple answer to your question is: it's by-design.

Hope this helps.

.: Francesco

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.