Skip to content

Commit

Permalink
make it easier to keep the filesystem read-only when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
jerkey committed Jan 4, 2016
1 parent e095b26 commit 2a65c31
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ ssh [email protected] "cd /root/doorjam; ./grant_access_to_last_attempt.js <name

You can also use the sudo_grant_access.sh script, but you should edit it to suit your environment.

change /etc/bash.bashrc to remind you when the filesystem is not read-only:
# PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
PS1='${debian_chroot:+($debian_chroot)}\u@\h`if grep "ec2c7555affb / ext4 rw" /proc/mounts > /dev/null; then echo \ FILESYSTEM IS WRITABLE, RUN roroot TO FIX; fi`:\w\$ '

# License and copyright

GPLv3+
Expand Down
7 changes: 7 additions & 0 deletions editaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
if grep "ec2c7555affb / ext4 ro" /proc/mounts > /dev/null; then
rwroot
vim /root/doorjam/access_control_list
roroot
else
vim /root/doorjam/access_control_list
fi
5 changes: 5 additions & 0 deletions roroot
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

echo SETTING FILESYSTEM TO READ-ONLY
sync
mount -o remount,ro /
4 changes: 4 additions & 0 deletions rwroot
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

echo SETTING FILESYSTEM TO READ-WRITE
mount -o remount,rw /

0 comments on commit 2a65c31

Please sign in to comment.