after extracting hadoop I open my .bashrc file and edit this

export HADOOP_HOME="/media/hadoop/linux/soft/hadoop-1.2.1"
export PATH

then save and open new terminal and type hadoop version but it say the permission problem of bash.

bash: /media/hadoop/linux/soft/hadoop-1.2.1/bin/hadoop: Permission denied

so what permission should I give??????

the command ls -l /media/hadoop/linux/soft/hadoop-1.2.1/bin

shows the result

total 144
-rw------- 1 hadoop hadoop 15147 জুল    23  2013 hadoop
-rw------- 1 hadoop hadoop  2643 জুল    23  2013 hadoop-config.sh
-rw------- 1 hadoop hadoop  5064 জুল    23  2013 hadoop-daemon.sh
-rw------- 1 hadoop hadoop  1329 জুল    23  2013 hadoop-daemons.sh
-rw------- 1 hadoop hadoop  2810 জুল    23  2013 rcc
-rw------- 1 hadoop hadoop  2050 জুল    23  2013 slaves.sh
-rw------- 1 hadoop hadoop  1166 জুল    23  2013 start-all.sh
-rw------- 1 hadoop hadoop  1065 জুল    23  2013 start-balancer.sh
-rw------- 1 hadoop hadoop  1745 জুল    23  2013 start-dfs.sh
-rw------- 1 hadoop hadoop  1145 জুল    23  2013 start-jobhistoryserver.sh
-rw------- 1 hadoop hadoop  1259 জুল    23  2013 start-mapred.sh
-rw------- 1 hadoop hadoop  1119 জুল    23  2013 stop-all.sh
-rw------- 1 hadoop hadoop  1116 জুল    23  2013 stop-balancer.sh
-rw------- 1 hadoop hadoop  1246 জুল    23  2013 stop-dfs.sh
-rw------- 1 hadoop hadoop  1131 জুল    23  2013 stop-jobhistoryserver.sh
-rw------- 1 hadoop hadoop  1168 জুল    23  2013 stop-mapred.sh
-rw------- 1 hadoop hadoop 63598 জুল    23  2013 task-controller

the unique part is that I try to install from downloaded file and stuck with some bash permission problem.Although if I follow the whole process of it. I may install hadoop properly but I want to know what's wrong with my process also notice that I follow this video.thanks

  • What is the output of ls -l /media/hadoop/linux/soft/hadoop-1.2.1/bin? (you can edit this into your question) – Wilf Jun 12 '15 at 10:52
  • Have you tried sudo hadoop version ? /media/hadoop/linux/soft/hadoop-1.2.1/bin is on / and only root has access not user – Mark Kirby Jun 12 '15 at 11:06
  • linux is an another partition which is not in root in my pc and the cmd sudo hadoop version shows the result [sudo] password for hadoop: sudo: hadoop: command not found – Rumy Jun 12 '15 at 11:09
  • brother @mark Kirby is there any solution??Help me to share with me. – Rumy Jun 12 '15 at 11:24
  • possible duplicate of How to install Hadoop? Your permission problem is probably step 2, follow this guide – Mark Kirby Jun 12 '15 at 12:51

It seems like the hadoop user does not have the required permissions.

Try: sudo chown -R hduser:hadoop /media/hadoop/linux/soft/hadoop-1.2.1

This command will make hduser (part of group hadoop) to be the owner of the directory /media/hadoop/linux/soft/hadoop-1.2.1. To do that recursively i.e. for all files and directories (and all files and directories within any directory), -R option is used.


You want to move the Hadoop installation to the /usr/local/hadoop directory. So, we should create the directory first:

hduser@Soumitra-PC:~$ sudo mkdir -p /usr/local/hadoop
[sudo] password for hduser:
hduser is not in the sudoers file. This incident will be reported.

This can be resolved by logging in as a root user, and then add hduser to sudo group:

hduser@Soumitra-PC:~/hadoop-2.6.0$ su soumitra
soumitra@Soumitra-PC:/home/hduser$ sudo adduser hduser sudo
[sudo] password for soumitra:
Adding user hduser' to groupsudo' ...
Adding user hduser to group sudo

Now, the hduser has root privilege, we can move the Hadoop installation to the /usr/local/hadoop directory without any problem:

soumitra@Soumitra-PC:/home/hduser$ sudo su hduser
hduser@Soumitra-PC:~$ sudo mkdir -p /usr/local/hadoop
[sudo] password for hduser:

Please not, before going into the next step, don’t forget to do a cd and go into the directory hadoop-2.6.0.

hduser@Soumitra-PC:~/hadoop-2.6.0$ sudo mv * /usr/local/hadoop

Detailed Step-by-Step Installation of Hadoop on Ubuntu, with detailed screenshots and Explanation:


This document has been created by me after installing several versions of Hadoop on several versions of Ubuntu. So, most of the common problems/errors/queries that a person faces while installing Hadoop on Ubuntu has been discussed in the above document.


When you are saving the "~/.bashrc" file, you need to do execute "source ~/.bashrc" command as well, to update the change you made in ~/.bashrc.

Then while opening new terminal, you need to do "su hduser". It should ask for password, enter the password. Now when you are in hduser mode, try running your hadoop version command. It should work.

Still if the problem persists, I would suggest you try installing hadoop afresh: Follow the link below. I have prepared this with sufficient explanations and step-by-step screenshots:


If you are stuck somewhere, feel free to ask.

Thank you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.