Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Script] binhex - no_ransom.sh

Featured Replies

  • Author

In case anybody is running Windows and would like a neat script to integrate the locking and unlocking of selected folders then let me know and i will share the code, i use this ALL the time now and it does reduce the pain of having your media immutable but wanting to change the odd file/folder, it's super quick as it only runs chattr for the selected folder, a quick demo: https://drive.google.com/file/d/1s4IJL4ofD58njFVre--vD8ZJzBYHAX1H/view?usp=sharing

  • 1 month later...
  • Replies 80
  • Views 26.6k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • OK guys, its been a while since i touched this script, mainly because it just works :-), small enhancement to the script, i have now added in the ability to 'lock' and 'unlock' chattr, in reality this

  • ok the fix is now in for spaces in share names, during my testing i also noted the default include extensions should be * not *.*, to ensure files with no extension are also locked (if no include exte

  • there are a 4 advantages that i can think of using my script over setting shares to read only:-   1. you can still add new files/folders to the share - the share is not read only and newly crea

Posted Images

  • Author

Hi all, new version just released, nothing mind blowingly cool, just some tweaks, the main breaking change is the change of separator from a comma to the pipe symbol for parameter values, changelog:

  1. We now do not un-obfuscate the name of chattr during the run this is left in a obfuscated state, the obfuscated name can either be not defined, in which case it's set to 'rttahc' (chattr in reverse) or the user can define their own obfuscated name via the parameter:

-sc|--secure-chattr <name>

  1. The script now uses the pipe symbol for separators when definine values for the parameters, this allows the script to operate for folder names that container comma's, so for example:

--exclude-extensions '*.jpg|*.png'

3. Removed option to lock chattr (obfuscate and change permissions), this is now enforced to ensure we minimise the risk of ransomware running the utility to unlock.

To update simply pull down the script, new version is 'v3.0.0':

curl -o <location you want the script to go to> -L https://raw.githubusercontent.com/binhex/scripts/refs/heads/master/scripts/unraid/system/no_ransom/no_ransom.sh

  • 1 month later...

Think you might have a minor bug
debug="{defaultDebug}"

should be

debug="${defaultDebug}"

image.png

Edited by xokia

  • Author
7 hours ago, xokia said:

Think you might have a minor bug
debug="{defaultDebug}"

Indeed!, not sure how i missed that!, fixed in 3.0.1 (just pushed).

A quick tip that tripped me up that might help someone else:

I run this script on my media share that goes cache->array. Well while I was moving all my files off my cache drive to reformat it, I forgot to disable the script cronjob or unlock everything first, and somehow ended up with some immutable folders/files for my 'media' share on my cache drive(after I was putting everything back to normal after formatting). It was alarming at first because running the unlocking version of the script wasn't reaching the cache drive, and it seemed like I was totally locked out of making any changes. I mistakingly tried to perform a reboot, and ended up with a unclean shutdown(unmounting was failing during shutdown). The server booted up fine but I have to run a new parity check now.

I'm still not exactly sure how I managed to get immutable folders/files onto my cache drive, as I thought they couldn't be moved? I did so many things for the first time today(added second drive, used unbalancing tool to move files off array drives to switch to encrypted, reformatted my single cache drive from xfs to zfs.)

I finally was able to correct it by running the chattr -i command(obfuscated name version) by itself specifically on the share in the cache drive.

I'm not very proficient with linux commands yet so this is all probably very obvious to a more seasoned linux user, and is also obviously not in any way a problem with the script. I actually love the script and the peace of mind it gives me.

  • 2 weeks later...

If you select to only lock 'files', can you still specify to '--include-folders'? Generally I am only trying to affect files but I would also like to include some folders with a specific keyword in the name. This isn't working as intended though, the folders containing the keyword never get made immutable. I even tried with wildcards like '*keyword*'.

The examples in the script show you being able to include folders while only selecting to lock 'files'. Is that incorrect and you have to select for 'both'? And if so, will it only include the ones that match the '--include-folders'?

Thanks

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.