Tmp folder deleted?

So i have a problem.

In order to free space from disk, i deleted my tmp folder, and then created another one. But when logging via ssh to my droplet, it promps this:

mktemp: failed to create file via template `/tmp/virtualenvwrapper-initialize-hook-XXXXXXXXXX’: Permission denied ERROR: virtualenvwrapper could not create a temporary file name.

How do I solve this?



Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.


You should verify permissions of your /tmp folder. Execute following command, it will return information about permissions and ownership:

  1. ls -ld /tmp

Default out should be that it have 1777 - drwxrwxrwt permissions and ownership is set to root:root.

ls -ld /tmp
drwxrwxrwt 11 root root 20480 Sep 22 09:35 /tmp

If this is not the case, two simple command could help you:

  1. sudo chmod 1777 /tmp
  2. sudo chown root:root /tmp

Permissions explained: 1 is sticky bit. When set, only owner of file can rename or delete it. 777 means that owner, group and everyone else can read, write and execute. So adding sticky bit to 777 -> 1777 would ensure only you can remove/rename files which you are owner

This comment has been deleted