Quantcast
Channel: Can a script be executable but not readable? - Unix & Linux Stack Exchange
Browsing latest articles
Browse All 10 View Live

Answer by mosvy for Can a script be executable but not readable?

It works on OpenBSD As already mentioned in a comment by @eradman, this is possible on OpenBSD. As root: hzy# cat <<'EOT' >/tmp/foo; chmod 001 /tmp/foo #! /bin/sh : this is secret echo done...

View Article



Answer by gaurav goyal for Can a script be executable but not readable?

Yes, if you are root user, you can execute file without read permission # echo "echo hello" > test # chmod 100 test # ll test ---x------ 1 root root 10 Nov 29 12:13 test # ./test hello But if you...

View Article

Answer by AncientMinds for Can a script be executable but not readable?

To make your scripts unreadable yet executable, you have 3 major options: First Option Use the openssl command to manually encrypt it. And in the future, when you want to run the script, you'll have to...

View Article

Answer by santana for Can a script be executable but not readable?

There's a half truth to the previous statements. You can setup a script so that it's not readable by the user, but still executable. The process is a little drawn out, but it's doable by making an...

View Article

Answer by user33577 for Can a script be executable but not readable?

On this situation I used sudo with a NOPASSWD option so the users can run the script without being able to read it.

View Article


Answer by quodlibetor for Can a script be executable but not readable?

You can, I think, do this with setuid. Except that you can't because most distros (apparently) have setuid disabled because it's a massive security hole. It's disabled on mine, so I don't actually know...

View Article

Answer by kwarrick for Can a script be executable but not readable?

This is possible only for binaries. $ chown foo:foo bar $ chmod 701 bar As the unprivileged user: $ ls -lha bar -rwx-----x 1 foo foo 7.0K 2012-03-15 03:06 bar $ cat bar cat: bar: Permission denied $...

View Article

Answer by Arcege for Can a script be executable but not readable?

The issue is that the script is not what is running, but the interpreter (bash, perl, python, etc.). And the interpreter needs to read the script. This is different from a "regular" program, like ls,...

View Article


Answer by Renan for Can a script be executable but not readable?

This is not possible, at least on Linux (other Unices might allow it); think about it, when you run the script, the shell needs to read it in order to know what to do.

View Article


Can a script be executable but not readable?

Is it possible to execute a script if there is no permission to read it? In root mode, I made a script and I want the other user to execute this script but not read it. I did chmod to forbid read and...

View Article
Browsing latest articles
Browse All 10 View Live


Latest Images