Added 2nd Raspberry Pi2 running OSMC - Cannot change Hostname, Permission Denied

Hi,

I have tried to change the hostname on the 2nd Raspberry Pi2 I’ve just added to my home network. I’ve read all the topics already posted here on this subject.

I’ve tried both by SSH’ing in with Putty and also doing directly on the Raspberry Pi2.

I’ve changed the Kodi names in Kodi>Settings>Service to Kodi1 and Kodi2 but cannot change the hostnames on either Pi. Both hostnames are OSMC, I am a complete Linux newbie but I have tried all the commands listed in the previous posts on this subject. Everything comes back as “Permission Denied”. Each Pi as been assigned a static IP in my router but I cannot see them both in File Explorer (Windows 8.1).

Please let me know how I can change my Permissions to allow me to change the hostnames. Both Pi’s have SMB (Samba) running and I can access all WORKGROUP folders/files from my Pi’s.

If you need me to upload any files to help you assist me, please let me know.

Thanks in advance,

Karen

What commands? Hard to help if we don’t know what you are doing…

edit /etc/hostname and /etc/host (permission denied)
/etc/fstab (permission denied)
/lib/systemd/system/transmission-daemon.service (user ‘debian-transmission’ does not exist)
sudo usermod -a -G osmc debian-transmission (user ‘debian-transmission’ does not exist)

I’ve tried the above listed commands.
K.

You have to make sure you are editing these files as the root user by prefixing the editor command with “sudo”.

The debian-transmission and fstab lines you list have nothing to do with hostnames.

As I said, I am a Linux newbie. I was trying to see if “Transmission” (mentioned in the posts about changing hostnames) had something to do with changing Permissions so I could change the hostnames.

I need to know why OSMC on the Pi’s is refusing me permission to change the hostnames and which commands I need to make the necessary changes.

Any ideas you have on this subject would be helpful.

Thank you,

Karen

sudo nano /etc/hostname

In the resulting editor, change “osmc” to whatever name you want. Then ctrl-x and y to save.

sudo nano/etc/hosts

Same here, change both instances of “osmc” and exit/save as above.

You will have to reboot your pi for these changes to take effect.

In the meantime, I’ve made a post that includes some linux command cheat sheets/guides and general linux tutorials that would likely be helpful for you.

1 Like

Thanks so much! I hesitate asking questions on this forum because my almost non-existent knowledge of Linux tends to make the people who respond a little testy. However, I love OSMC and want to continue using it so, after checking every other source, I turn to the experts on this forum.

Thank you for assisting me and the cheat sheets/guides (while technically out of the scope of this forum) will be a great help to me and many others.

Best regards,

Karen

1 Like