LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-12-2018, 02:27 PM   #1
jr_bob_dobbs
Member
 
Registered: Mar 2009
Distribution: Bedrock, Devuan, Slackware, Linux From Scratch, Void
Posts: 651
Blog Entries: 135

Rep: Reputation: 188Reputation: 188
one-time fake read-only filesystem and hidden net


I would like to run a program in such a way that, for just that invocation of that program:

1. The file system appears as read only, as if the partition(s) had been mounted read-only. There would be two exceptions:

1a. The current directory and any sub-directories would be writable.

1b. /tmp and any sub-directories would be writable

2. No net is visible, accessible nor usable.

This would usually be run as root. This would usually be for running something from the command line.

What would be a good way to do this?

Thank you.
 
Old 03-12-2018, 10:22 PM   #2
jr_bob_dobbs
Member
 
Registered: Mar 2009
Distribution: Bedrock, Devuan, Slackware, Linux From Scratch, Void
Posts: 651

Original Poster
Blog Entries: 135

Rep: Reputation: 188Reputation: 188
Got it. Firejail is a solution, yay.

So, to run bash in the way that I wanted:
Code:
firejail --noprofile --nonewprivs --net=none \
  --read-only=/ --read-write=/tmp --read-write=`pwd` \
  bash
Order may matter: I have the read-write bits occur *after* specifying the entire file system read-only.

Firejail seems to like absolute paths, so that is why I used `pwd` instead of . for the current directory. This may not be necessary?

Last edited by jr_bob_dobbs; 03-12-2018 at 10:26 PM.
 
Old 03-13-2018, 05:17 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626
Thanks for the update and solution.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] encrypted system with hidden real OS under fake OS lleb Linux - Security 11 02-09-2014 01:07 PM
read time of /proc/net/tcp6 file geddysekar Programming 2 12-09-2010 08:13 AM
One in four gives fake net names Jeebizz Linux - News 0 09-08-2010 12:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration