Search code examples
amazon-ec2centoskibanaelastic-stackamazon-linux-2

Permission Denied when trying to change to Kibana directory


I am in the process of configuring an ELK Stack in an EC2 instance, which runs on Amazon Linux 2 OS(CentOS). As the third step, I have just installed Kibana in my remote machine . According to this tutorial on Elastic.co , I have to modify a file named kibana.yml in order to unlock its full functionality. The file is said to be located in /etc/kibana directory. The directory already exists. However, I cannot cd to the Kibana directory. For the normal cd command, I get the error

-bash: cd: /etc/kibana/: Permission denied

When I use the same command with sudo prefix, I do not get any error, however, it doesn't change to the directory either.

Any idea on how to bypass this and enter the directory?

P.S : I am not sure if this is an issue specific to Kibana or not. However, this is the first time I have encountered an issue like this in a CentOS system.


Solution

  • There are two ways to bypass this, although I am still not clear why the Permission Denied error appears. But since I got the solution to my issue, I am posting this as the answer.

    1. @Raman's answer : Editing the file using sudo and giving the full address to the file, without changing the directory.

      sudo vi /etc/kibana/kibana.yml

    2. My answer : Enter the Root mode using sudo su command and that would allow you to change to the kibana directory.