NTFSSECAUDIT(8)

โœจ NAME โœจ

okay bestie, meet ntfssecaudit ๐Ÿ’– (the manual page for ntfssecaudit(8)) and it's all about NTFS Security Data Auditing ๐Ÿ”ฅ

๐Ÿ‘‘ SYNOPSIS ๐Ÿ‘‘

ntfssecaudit [options] args

Where options is a combo of these ๐ŸŽ€:

  • -a โ€” full auditing of security data (Linux only) ๐Ÿ”
  • -b โ€” backup ACLs ๐Ÿ’พ
  • -e โ€” setting extra backed-up parameters (goes with -s) โœจ
  • -h โ€” displaying hexadecimal security descriptors saved in a file ๐Ÿงพ
  • -r โ€” recursing in a directory ๐ŸŒ€
  • -s โ€” setting backed-up ACLs ๐Ÿ› ๏ธ
  • -u โ€” getting a user mapping proposal ๐Ÿซถ
  • -v โ€” verbose (very verbose if you set it twice) ๐Ÿ“ข

And args defines the parameters and the set of files that get acted upon ๐Ÿฆ‹

Typing secaudit with no args will show you a summary of the available options ๐Ÿ™ˆ

๐ŸŒธ DESCRIPTION ๐ŸŒธ

okay so ntfssecaudit shows you the ownership and permissions of a set of files on an NTFS file system, and checks that they're consistent ๐Ÿ’… It can only be run in terminal mode, because there's no graphical user interface, so no fancy windows here ๐Ÿฅฒ

When a volume is needed, it has to be unmounted first, and the command has to be issued as root ๐Ÿ‘‘ The volume can be either a block device (like a disk partition) or an image file ๐Ÿ’œ

When you're acting on a directory or volume, this command can spit out a LOT of information ๐Ÿ˜ญ So it's highly advisable to redirect the output to a file, or pipe it into a text editor so you can actually read it ๐Ÿ“

๐ŸŽ€ OPTIONS ๐ŸŽ€

Here are the valid combos of options and arguments that ntfssecaudit accepts ๐Ÿ’– Every indicated argument is mandatory and must be unique. If you use wildcards, they have to resolve to a single name, no exceptions ๐Ÿ™…โ€โ™€๏ธ

  • -h file โ€” Shows, in a human readable form, the hexadecimal security descriptors saved in file ๐Ÿงพ This is how you can turn a verbose output into a very verbose one ๐Ÿ“ข
  • -a[rv] volume โ€” Audits the volume ๐Ÿ” All the global security data on the volume gets scanned and errors get displayed. Add -r and every file and directory gets scanned too, and their relations to the global security data get checked. Heads up, this can produce a lot of data ๐ŸŒŠ

This option does nothing on volumes formatted for old NTFS versions (pre NTFS 3.0), because those volumes have no global security data ๐Ÿฅฒ

If errors pop up, it's a good idea to repair the volume with an appropriate tool, like chkdsk on Windows ๐Ÿ”ง

  • [-v] volume file โ€” Displays the security parameters of file โœจ That means its interpreted Linux mode (rwx flags in octal) and its Posix ACL[1], its security key if it has one, and its security descriptor if you're in verbose mode ๐Ÿ’…
  • -r[v] volume directory โ€” Shows the security parameters of all files and subdirectories in directory ๐ŸŒ€ You get their interpreted Linux mode (rwx flags in octal) and Posix ACL[1], their security key if any, and their security descriptor if verbose output is on ๐Ÿฆ‹
  • -b[v] volume [directory] โ€” Recursively extracts the NTFS ACLs of files in volume and directory to standard output ๐Ÿ’พ
  • -s[ev] volume [backup-file] โ€” Sets the NTFS ACLs as indicated in backup-file or standard input ๐Ÿ› ๏ธ The input data must have been created on Linux, bestie, no exceptions ๐Ÿง With -e, it also sets extra parameters (currently Windows attrib) โœจ
  • volume perms file โ€” Sets the security parameters of file to perms ๐ŸŽฏ perms is either the Linux requested mode (rwx flags, written in octal form like chmod) or a Posix ACL[1] (written like setfacl -m). This sets a new ACL that's effective for both Linux and Windows ๐Ÿซถ
  • -r[v] volume perms directory โ€” Sets the security parameters of all files and subdirectories in directory to perms ๐ŸŒˆ perms is the Linux requested mode (rwx flags, octal form like chmod), or a Posix ACL[1] (written like setfacl -m). This sets new ACLs that are effective for both Linux and Windows ๐Ÿ’–
  • [-v] mounted-file โ€” Displays the security parameters of mounted-file ๐Ÿ‘€ That's its interpreted Linux mode (rwx flags in octal) and Posix ACL[1], its security key if any, and its security descriptor if you're verbose. This one's a special case that acts on a mounted file (or directory) and does NOT need root ๐Ÿ™Œ The Posix ACL interpretation only shows up if you give the full path to mounted-file from the root of the global file tree ๐ŸŒณ
  • -u[v] mounted-file โ€” Displays a proposed content for a user mapping file ๐Ÿซถ It's based on the ownership parameters Windows set on mounted-file, assuming this file was created on Windows by the user who should get mapped to the current Linux user ๐Ÿชž Copy the displayed info into the file .NTFS-3G/UserMapping, where .NTFS-3G is a hidden subdirectory at the root of the partition you want the mapping for ๐Ÿงš Once that's done, files created on that partition will be owned the same way as the original mounted-file ๐Ÿ’…

๐Ÿ“ NOTE ๐Ÿ“

[1] This works provided the POSIX ACL option was selected at compile time ๐Ÿ› ๏ธ A Posix ACL specification looks like "[d:]{ugmo}:[id]:[perms],...", where id is a numeric user or group id, and perms is an octal digit or a set from the letters r, w and x ๐ŸŒธ

Example: "u::7,g::5,o:0,u:510:rwx,g:500:5,d:u:510:7" ๐Ÿ“

๐Ÿงช EXAMPLES ๐Ÿงช

Audit the global security data on /dev/sda1 ๐Ÿ”

ntfssecaudit -ar /dev/sda1

Display the ownership and permissions parameters for files in the directory /audio/music on device /dev/sda5, excluding sub-directories ๐ŸŽต

ntfssecaudit /dev/sda5 /audio/music

Set all files in the directory /audio/music on device /dev/sda5 as writeable by the owner and read-only for everybody else ๐Ÿ”’

ntfssecaudit -r /dev/sda5 644 /audio/music

๐Ÿšฆ EXIT CODES ๐Ÿšฆ

ntfssecaudit exits with a value of 0 when no error was detected ๐Ÿฅณ and with a value of 1 when an error was detected ๐Ÿ’€

๐Ÿ› KNOWN ISSUES ๐Ÿ›

Please peek at this page for common questions and known issues ๐Ÿ‘€

https://github.com/tuxera/ntfs-3g/wiki/NTFS-3G-FAQ/

If you find a new one in the latest release of the software, send an email describing it in detail ๐Ÿ’Œ You can contact the development team at ntfs-3g-devel@lists.sf.net ๐Ÿซถ

๐Ÿ‘ฉโ€๐Ÿ’ป AUTHORS ๐Ÿ‘ฉโ€๐Ÿ’ป

ntfssecaudit has been developed by Jean-Pierre Andrรฉ ๐Ÿ‘‘

๐ŸŒˆ THANKS ๐ŸŒˆ

Several people made heroic efforts, often over five or more years, which resulted in the ntfs-3g driver ๐Ÿ˜ญ The most important ones are Anton Altaparmakov, Richard Russon, Szabolcs Szakacsits, Yura Pakhuchiy, Yuval Fledel, and the author of the groundbreaking FUSE filesystem development framework, Miklos Szeredi ๐Ÿ’–โœจ

๐Ÿ”— SEE ALSO ๐Ÿ”—

ntfsprogs(8), attr(5), getfattr(1) ๐Ÿฆ‹


Okay that's a wrap, bestie ๐ŸŽ€ This was ntfssecaudit version 1.5.0 from February 2010, and it's still giving main character energy ๐ŸŒŸ๐Ÿ’…

๐Ÿ“ฆ where this page comes from