I need to delete a specific .docx that a user posted with sensitive information as soon as possible. Please help! ![]()
AI-generated summary
alehandrof urgently needed to delete a .docx file containing sensitive information that was uploaded by a user. Initially, they couldnāt locate the file using find . | grep "3_FILE_ID.docx", assuming it would be in /shared/standalone/uploads/default. csmu suggested checking the uploads/default/original/ directory and noted that filenames are often hashed, advising to use ls *.docx to list matching files. csmu also recommended verifying file contents before deletion. alehandrof eventually found the file by running ls -Rl | grep ".docx" in /var/discourse/shared/standalone/uploads/, identifying the correct file by its recent timestamp. They confirmed it by downloading it via scp to their local machine, then deleted it with rm. pfaffman later noted that right-clicking the file link in the post could reveal the actual server path, avoiding manual search ā though alehandrof clarified the filename in the post differed from the system filename, which initially confused them. The file was successfully removed, resolving the security concern.
Sorry for not including more details in my OP, I was a bit panicked. Hereās a bit more background.
The file was originally published in a post I have since deleted. The link to the file in that post was something like like this: https://example.com/uploads/short-url/3_FILE_ID.docx
I assumed that the file would be somewhere in /shared/standalone/uploads/default, but I havenāt been able to find it through this:
find . | grep "3_FILE_ID.docx"
So thatās where Iām stuck currently.
If it happened to me Iād start looking in the uploads folder.
Example
csmubd2lcomau:~ admin$ /scripts/connect-to-server/sydney-10.8.0.1.sh
ssh -R 52698:localhost:52698 ceiteach@ceiteach@10.8.0.1
Last login: Tue Jun 18 16:15:05 2019 from 10.8.0.2
[ceiteach@sydney ~]$ sudo bash
[root@sydney ceiteach]# cd /var/discourse/shared/standalone/uploads/default/o
optimized/ original/
[root@sydney ceiteach]# cd /var/discourse/shared/standalone/uploads/default/original/1X/
[root@sydney 1X]# ls *.docx
2d7aced744661d422e1b66e02a12f1617acf13ed.docx e759a55a7284e4bc80f6be55a3013d4c49e8277b.docx
[root@sydney 1X]# pwd
/var/discourse/shared/standalone/uploads/default/original/1X
Maybe revoke read privileges ⦠check the consequences of removing the file .. and delete the post that the user made.
ls *.docx and check the contents of the files you find.
the file name might be a hash of the contents.
Thanks @csmu for the help, I found the file!
Iāll document what I ended up doing in case this is helpful for future travellers:
-
I navigated to the
/var/discourse/shared/standalone/uploads/ -
I searched for the relevant filetype like this:
ls -Rl | grep ".docx"(I was originally searching for files published in 2019 without noticing that for files created in the current year the
lflag replaces the year with the creation time.) -
I looked at the list of files and found the one (there was only one in my case) that was posted today.
-
I downloaded the file to make sure, by using a command like this on my local machine:
scp servername:/var/discourse/shared/standalone/uploads/default/original/2X/1/FILE_ID.docx ~/Downloads -
After I confirmed that it was the file I wanted, I just deleted it (
rm /var/discourse/shared/standalone/uploads/default/original/2X/1/FILE_ID.docx)
Rejoice!
Glad you found it! If you need to do it again, If you still have the post that links the file, you can right click to get the path /filename rather than spelunking to find it.
The filename linked to in the post was different from the filename in the system. Thatās what threw me off originally.