0 votes
1 view
in Devops and Agile by (11.5k points)

I have two VMs, one is the master and the other is the worker. I'm trying to create a kubernetes cluster. When I try to edit the hosts name, I get the following error:

"hosts" E212: Can"t open file for writing

1 Answer

0 votes
by (31.4k points)

Firstly, execute this command:

 sudo su

When you will be asked for password, just simply give the password.

After that you can edit the hosts file using any one of the below commands:

nano /etc/hosts 


vi /etc/hosts

Welcome to Intellipaat Community. Get your technical queries answered by top developers !