Heylo,
So I've been searching on why this is happening for two days now... I've read many threads on this site and tried all of the relevant advice given but to no avail.
When trying to run a TCP Proxy on a test ftp client I get the following error:
sudo: ./TCP_Proxy.py: command not found
The full command is:
sudo ./TCP_Proxy.py 127.0.0.1 21 ftp.target.ca 21 True
I've tried
brew install sudo
to make sure that sudo is installed and it is. I've also done the ls command and the file in question is indeed listed. I'm kind of at a loss and would appreciate any help you may offer. Thank you.
CK
sudo chmod +x TCP_Proxy.py
Will do the job,
Using Python,you could create a simple script that could be run first to give the intend file permission like:
import os
import stat
st = os.stat('TCP_Proxy.py')
os.chmod('TCP_Proxy.py', stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
The following are the full flags
stat.S_IRWXU Mask for file owner permissions.
stat.S_IRUSR Owner has read permission.
stat.S_IWUSR Owner has write permission.
stat.S_IXUSR Owner has execute permission.
stat.S_IRWXG Mask for group permissions.
stat.S_IRGRP Group has read permission.
stat.S_IWGRP Group has write permission.
stat.S_IXGRP Group has execute permission.
stat.S_IRWXO Mask for permissions for others (not in group).
stat.S_IROTH Others have read permission.
stat.S_IWOTH Others have write permission.
stat.S_IXOTH Others have execute permission.
stat.S_ENFMT System V file locking enforcement. This flag is shared with S_ISGID: file/record locking is enforced on files that do not have the group execution bit (S_IXGRP) set.
stat.S_IREAD Unix V7 synonym for S_IRUSR.
stat.S_IWRITE Unix V7 synonym for S_IWUSR.
stat.S_IEXEC Unix V7 synonym for S_IXUSR.