777 is a bit extreme. Perhaps it’s just the executable flag, in which case you should try chmod +x first.
I'm bad at linux :)