chmod
changes the abilties of the file, if it can be executed, read and written. It applies these abilties for three groups (ignoring extended attributes). These groups are user, group and world.
So, chmod lets you say make a file readable, by user. 'User' ni this case is decided by whomever owns the file.
The owner can be changed using chown
.
With this in mind, you likely need to chmod the file to have +r (read) set, and it likely needs to be owned by the user who'll be running it.
chmod 700 ~/.xsessions
chown user
Replacing 'user' with the username of the user who'll be running the session.
Also note, it's refering to the file by using the 'shortcut' ~, which is replaced by /home/user/, so if you were calling this as root, and your user is called ZR_
you'll need to run:
chmod 700 /home/ZR_/.xsessions
chown /home/ZR_/.xsessions ZR_
1I think you simply need to chown file to user:user instead. – the.malkolm – 2019-05-26T20:14:06.903