Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • aports aports
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Graph
    • Compare
  • Issues 661
    • Issues 661
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 337
    • Merge requests 337
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • alpinealpine
  • aportsaports
  • Issues
  • #6621
Closed
Open
Issue created Jan 04, 2017 by Michal Mičko@michal.micko

su username -c "some command" ends with an error message: /bin/sh Permission denied

I tried create Docker container based on image imported from minirootfs

https://fr.alpinelinux.org/alpine/v3.5/releases/x86_64/alpine-minirootfs-3.5.0-x86_64.tar.gz

or based on image from Docker hub library

Dockerfile

FROM alpine:3.5

When I start Docker container (and create user)

docker exec -it container_name /bin/sh

and run command inside like:

su username -c "some command"
su username -c "ls"

or

docker exec -it container_name su username -c "ls"

I get error message: /bin/sh Permission denied

/bin/sh is shell from /etc/passwd

I tried gradually create user with shell:

  • /bin/ash
  • /bin/false
  • /sbin/nologin

with same result.

(from redmine: issue id 6621, created on 2017-01-04)

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking