Posted March 11, 2014 3.1k views
hello digital ocean, then q did the tutorial swapfile I can no longer log in with my normal User, the permission denied and it was after these commands, such as undo them or allow me loge with a normal User is not root sudo chown root: root / swapfile sudo chmod 0600 / swapfile plz help me

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer
Did you have any snapshots of your server before running these commands?
The reason I'm asking is that you have some errors in your commands, allow me to explain:

sudo chown root: root / swapfile
^ ^

Notice there's a space between ":" and "root" and also another space between "/" and "swapfile". What this means is that you assigned EVERYTHING under "/" (basically all your filesystem) to the root user with an inexistent group (" root").

sudo chmod 0600 / swapfile

Same as before, the space between "/" and "swapfile" is interpreted as a separator, meaning that you are applying the file permissions 0600 (Read-Write only to the group) to EVERYTHING under "/" and a file called "swapfile" that should be in the current directory, and since no group called " root" (with a space) exists, nothing else has permissions to do anything in your server rendering it unusable.