Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't execute binaries with sudo inside AppImage - "command not found" #353

Open
spvkgn opened this issue Apr 28, 2024 · 0 comments
Open

Comments

@spvkgn
Copy link

spvkgn commented Apr 28, 2024

Sample AppImageBuilder.yml:

version: 1

AppDir:
  path: ./AppDir

  app_info:
    id: org.gnu.bash
    name: bash
    icon: utilities-terminal
    version: 5.0.16
    exec: bin/bash
    exec_args: $@

  apt:
    arch: amd64
    allow_unauthenticated: true
    sources:
      - sourceline: 'deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse'
        
    include:
      - bash
      - coreutils
    exclude:
      - libpcre3

AppImage:
  arch: x86_64
  comp: gzip

The AppImage is successfully built:

$ ./bash-5.0.16-x86_64.AppImage --version | head -n1
GNU bash, версия 5.0.16(1)-release (x86_64-pc-linux-gnu)

Execute any binary inside AppImage:

$APPDIR/usr/bin/head -n1 /etc/os-release
PRETTY_NAME="Ubuntu 22.04.2 LTS"

But when I try to execute it with sudo - it fails with error "command not found":

sudo $APPDIR/usr/bin/head -n1 /etc/os-release
[sudo] пароль для pavel:
sudo: /tmp/.mount_bash-4mDX6hg/usr/bin/head: команда не найдена
LC_ALL=C sudo $APPDIR/usr/bin/head -n1 /etc/os-release
[sudo] password for pavel:
sudo: /tmp/.mount_bash-4mDX6hg/usr/bin/head: command not found
$ LC_ALL=C $APPDIR/usr/bin/head -n1 /etc/sudoers
/tmp/.mount_bash-582FuSk/usr/bin/head: cannot open '/etc/sudoers' for reading: Permission denied

$ LC_ALL=C sudo $APPDIR/usr/bin/head -n1 /etc/sudoers
[sudo] password for pavel: 
sudo: /tmp/.mount_bash-582FuSk/usr/bin/head: command not found

$ stat -c '%A %a %n' /etc/sudoers
-r--r----- 440 /etc/sudoers
@spvkgn spvkgn changed the title Can't execute binaries inside the AppImage with sudo - "command not found" Can't execute binaries inside AppImage with sudo - "command not found" Apr 28, 2024
@spvkgn spvkgn changed the title Can't execute binaries inside AppImage with sudo - "command not found" Can't execute binaries with sudo inside AppImage - "command not found" Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant