To change the hostname in the current session, you can use the command 'hostname':
hostname your_desired_hostname
To set the hostname permanently, you need to edit the file '/etc/hostname'. Open this file in an editor and replace the existing hostname with your new one and save the file.
Also, edit '/etc/hosts' to ensure local name resolution works. Open this file in an editor and add the following line:
your_vps_ip_address your_desired_hostname
Replace your_vps_ip_address with your VPS's ip address.