4

I work in IT-department and we have a situation. We have public computers installed in city library and they are using Ubuntu 12 kind off kiosk operating system. People are opening and downloading personal files via firefox and the files are saved to home/dowloads. I can't figure out how to make so that you can only open files from firefox without them being downloaded to computer or make some kind off scheluded empty folder task that the next user can't read someone others files from the downloaded files.

8

I focused on this:

without them being downloaded to computer

There is a Mozilla tool for this called mkiosk:

Firefox Kiosk Mode with optional Tabs Guides for Public Access Point. Complete solution. Block downloads/addon, bookmarks, reset kiosk inactivity, retry on errors, restricted interface, show favorites as buttons and more!

This will fully block downloads from Firefox (and also prevent any changes to settings (like importing profiles and things like that)).

3

The Solution for your problem will be a shell script which will delete those downloaded files in regular time intervals.

Put this in your shell script and save it as deldownloads.sh

find /home/<username>/Downloads/* -mtime +1 -exec rm -f {} \;

More options

  1. You can change the path to point to any folder. Make sure you use absolute path.

  2. You can change the time interval. -mtime refers to number of days while -mmin refers to number of minutes.

  3. You can set the time criteria. A “+5″ value means more than 5 days/minutes while a “-5″ value means 5 days/minutes or less. You can also use a combination like “+5 -10″ to denote an interval that is more than 5 days/minutes and less than 10 days/minutes.

  4. The “exec” command will work for command like “cp”, “mv”, “rm”, “rmdir” etc. Other than deleting old files, you can get it to perform other tasks as well, such as moving a file out of Dropbox folder.

Now run this command

sudo chmod 777 deldownload.sh

Method 1

Open the File Manager app and browse to the Home folder. Right click on the “find-and-delete” file and select Properties. Go to the Permissions tab and check the box “Allow executing file as program”.

Finally comes the automation step.

Next, open up the Startup Application and add the the “deldownload.sh” file to the list.

Method 2

If you need the script to run on a regular interval, you can set a cron job.

Open a terminal and type the following:

crontab -e

If it prompts you to select an editor, enter “2” (for nano).

The structure for cron setup is

minute hour day-of-month month day-of-week command

To run the script at every hour, enter

00 * * * * /path/to/find-and-delete

at the end of the crontab file, on a new line.Save (Ctrl + o) and exit (Ctrl + x) the crontab.

  • This is arbritrary so does not seem to be a good method to me: if a user is active for 10 minutes or for 4 hours should not matter to the solution. Yours does. If you go this way I would advice to add a script connected to log out and not "every hour". Example: askubuntu.com/questions/293312/… – Rinzwind Jul 24 '15 at 10:15
  • You also add the path to the script as suggested in This link – redchief Jul 24 '15 at 10:28
  • chmod 777: nonononono! Never ever run chmod 777. It is practically never required! Not even for "testing purposes". If the file is readable, then it's readable. If it's writable by the user or group that need to write to it, then it's writable. There is absolutely zero need to give everyone write permissions, and forgetting to chmod it back to something sane is exactly how multinationals get hacked. Just don't do it. Ever. I wrote an introduction of Unix permissions. Please read it! – Martin Tournoij Mar 13 '16 at 6:05
3

When users log in as a guest, their entire home directory is clean and is deleted as soon as they log out.

Of course, asking users to log in to Ubuntu and to log out when they're done may not be as convenient for them as a browser in kiosk mode.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.