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