Drive os 5.2.6 flashed image cannot change hostname

After I flashed the drive os 5.2.6, I found that the hostname cannot be changed. Everytime I changed the hostname in /etc/hostname and /etc/hosts, but after reboot it changes to tegra-ubuntu again. When the hostname is different from the two files, sshd will fail and we will not be able to ssh to this machine. This would be a problem if we install multiple machines with drive os 5.2.6. Please advise us how to address this issue. Thanks

I’m having the same issue with the resetting of hostname, and on top of that the command always fails the first time I try. On the second try it works:

nvidia@tegra-ubuntu:~$ sudo hostnamectl set-hostname newhostname
[sudo] password for nvidia:
Could not set property: Access denied
nvidia@tegra-ubuntu:~$ sudo hostnamectl set-hostname newhostname
sudo: unable to resolve host newhostname