I'm trying to get the md5sum of a directory, however everytime I try I'm getting permissions denied. I have root access and sudo. I'm able to create files and such in the directory but it will not allow me to find the md5sum of the directory contents. What I've tried so far:
baal@baal-Aspire-5733Z:~/bin/python/dagon$ md5sum * > data.txt
bash: data.txt: Permission denied
baal@baal-Aspire-5733Z:~/bin/python/dagon$ sudo !!
sudo md5sum * > data.txt
bash: data.txt: Permission denied
baal@baal-Aspire-5733Z:~/bin/python/dagon$ touch data.txt
touch: cannot touch 'data.txt': Permission denied
baal@baal-Aspire-5733Z:~/bin/python/dagon$ sudo !!
sudo touch data.txt
[sudo] password for baal:
baal@baal-Aspire-5733Z:~/bin/python/dagon$ sudo md5sum * > data.txt
bash: data.txt: Permission denied
baal@baal-Aspire-5733Z:~/bin/python/dagon$ sudo !!
sudo sudo md5sum * > data.txt
bash: data.txt: Permission denied
baal@baal-Aspire-5733Z:~/bin/python/dagon$ cd ..
baal@baal-Aspire-5733Z:~/bin/python$ sudo chmod 775 dagon
baal@baal-Aspire-5733Z:~/bin/python$ cd dagon
baal@baal-Aspire-5733Z:~/bin/python/dagon$ sudo find type -f -exec md5sum '{}' \; >md5sum.txt
bash: md5sum.txt: Permission denied
baal@baal-Aspire-5733Z:~/bin/python/dagon$
Does anybody have any idea why I would not be able to recursively get the md5sum of the directory? This directory was cloned from git if that makes any difference.
ls -ld .
when you are in this directory? Have you try to use other directory to store this hash file? – Romeo Ninov Jul 17 '17 at 13:02drwxrwxr-x 11 root root 4096 Jul 17 08:04 .
is the output – 13aal Jul 17 '17 at 13:09sudo
all me to run the command with elevated privileges then? – 13aal Jul 17 '17 at 13:17