Sep 21

GL-35DSR and locked files

TerminalA couple of months ago, I have bought a NAS to store my digitalized CD archive centrally. I wanted to access my files from my netbook, desktop PC or hotel PC while travelling. The NAS is running some unix-based operating system, what is something I’m not very familiar with. Indeed, I ran into a lot of issues, never anything critical, but this one kept me busy.

Avoid configuring two accounts – and when, never delete the uploader!

I have configured two accounts, one is my personal and the other is an internal admin (but not root!). This is where the trouble started because write permissions are only granted to the account, who have uploaded a file. Others may only read and execute. Okay, it makes sense; just the uploader can delete the file. It prevents an unintentional lost of files. This works very well for a while, but then I deleted the uploader account and all files are now owned by www-data. None of my known accounts could delete a file or folder. They were orphaned.

‘Hacking’ a NAS

A lot of different approaches later, I’ve tried connections via WebDAV, different FTP Clients, HTTP and lastly SSH. There I logged in as admin but didn’t have the permissions to use the chmod or chown utility. Even running su wasn’t allowed. Discouraged I tried to connect as root, neither the knowledge whether the account exists nor a possible password. I was surprised when I noticed that root:root works, but was also surprised that ls returned nothing.

The solution

Finally, one of my colleagues brought me back on track. He reminds me, that root may have had a special login folder – and he was right after all. This can be proved with a short check of my current position via pwd (I thought, it was an acronym for password. But it means print working directory.). Now I could navigate to my Music folder, which is located in ../shares/internal/nas/Public/ on this system. Now, I ran a chown on the locked folder and finally was able to delete it. The complete ssh session was as following:

noname:~ elyon$ ssh root@
root@'s password:
[root@GL-35DSR ~]# pwd
[root@GL-35DSR /]# cd /shares/internal/nas/Public/
[root@GL-35DSR Music]# chown -R Nina Music

In the last row, Nina is the account to give ownership to. The parameter -R stands for recursive.

Permanent link to this article: http://project89.com/gl-35dsr-and-locked-files-181/

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>