Changing the Workspace's Hostname



How can I change the hostname of my workspace?
I tried changing it on these files:
When I ran sudo hostname -F /etc/hostname, I got this result:
hostname: you must be root to change the host name
I also used su rather than sudo, but that didn’t help either. I tried rebooting it, but I ended up in the same situation. Any help would be greatly appreciated, thanks.