Support Questions

Find answers, ask questions, and share your expertise

Permission denied when removing file from HDFS from sandbox

New Contributor

Hi all,

Default Hortonworks Sandbox 2.3.2 running in VirtualBox on Mac El Capitan. I noticed when using the HDFS file manager GUI (at ), any directories or files created are owned by "admin". Then, if I create directories or files by connecting to HDFS from the hadoop 2.7.1 command line client, they're owned by "matthew" (my Mac account name):

$ bin/hadoop fs -ls hdfs:// 10:25:33
WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Found 2 items
-rw-r--r--   3 matthew hdfs  116795988 2015-12-17 17:17 hdfs://
-rw-r--r--   3 matthew hdfs   19465998 2015-12-17 17:13 hdfs://

After creating those files, I can't delete them using the HDFS file manager GUI -- there is no delete (trash can) icon for the files owned by "matthew".

I then tried to delete them via hadoop 2.7.1 with command

bin/hadoop fs -rm -r -f hdfs://

and I get an exception that starts with Permission denied: user=matthew, access=WRITE, inode="/user/matthew/.Trash/Current/tmp":hdfs:hdfs:drwxr-xr-x

I tried to ls /user/matthew with command

bin/hadoop fs -ls hdfs://

and got

ls: `hdfs://': No such file or directory

How do I remove files created via the hadoop command line client in the Hortonworks Sandbox 2.3.2?




@Matthew Adams

su - hdfs

hdfs dfs -chown -R matthew:hadoop /user/matthew

then try deleting it

View solution in original post


@Matthew Adams

su - hdfs

hdfs dfs -chown -R matthew:hadoop /user/matthew

then try deleting it

New Contributor

My mac has no user "hdfs".

$ su - hdfs
su: Sorry

Am I supposed to ssh into the sandbox and execute these commands?

Further, there is no directory found called "/user/matthew" as I indicated in my original question, so if I'd be chown'ing something that doesn't exist.

I'm confused...

Yes , please login into sandbox or you can do ssh from mac

HW11326:Downloads nsabharwal$ ssh root@ -p 2222

root@'s password:

Last login: Thu Dec 17 23:34:06 2015 from

[root@sandbox ~]# su - hdfs

[hdfs@sandbox ~]$

New Contributor

@Neeraj Sabharwal, that did the trick. Thanks!

@Matthew Adams hdfs is life root user 😉 superuser

If this thread is resolved then please accept one of the answers...Thanks for testing


hdfs dfs -mkdir /user/admin/matthew might be required.

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.