Question:
Ubuntu Access Denied Even Using ROOT?
Jeanprixx
2009-09-16 00:13:43 UTC
Hi! i would like to ask why can't i access /etc/hostname comaand i already using administrative users "#"

but when i try to type /etc/hostname it replies with

bash: /etc/hostname: Permission Denied.

i need to change hostname for some office PC. if you have better idea i can use i would appreciate it very much thanks.

Same Problem happens when i try to edit network interfaces using command line /etc/network/interfaces
Four answers:
Brian
2009-09-16 00:30:39 UTC
looks like hostname is a text file. try vi /etc/hostname under root. if you haven't used vi before then you should know u need to hit insert to start typing, escape when finished typing and type :wq to save. looks like interfaces is the same issue.
Bryan A
2009-09-16 00:29:09 UTC
It sounds like you are typing in just "/etc/hostname". This will be denied because this is a non-executable file. You need to put the name of an editor program, such as nano, emacs, or vi before the /etc/hostname. Such as "nano /etc/hostname". Then you should be able to edit the file in question.
mcgahee
2016-12-03 05:24:53 UTC
Chris D is quite top, yet i might desire to function something. using way you have written that command, Ubuntu assumes which you have a userid and password on the different device, and that they seem to be a similar using fact those you're logged on with. If that may no longer the case, you may desire to grant your userid and password for the different device in the scp command.
anto
2009-09-16 01:46:54 UTC
What command do you use?



try



sudo gedit /etc/hostname


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...