This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
KillaVanilla's profile picture

[1.4+] MuSeOS - Now Supports Turtles!

Started by KillaVanilla, 15 September 2012 - 03:19 PM
KillaVanilla #1
Posted 15 September 2012 - 05:19 PM
News:

[9/16/12] We now have an autoupdater!

[9/16/12] Now supports turtles!



MuSeOS stands for Multiuser Secure Operating System.


This OS supports:
  • Multiple users, including a superuser account labeled root
  • Home folders
  • User settings folders
  • Folder Protection (i.e nobody but root can access certain folders)
  • User API
  • Logging
  • Automatic API loading
  • Multiple startup files
  • Turtles / Turtle Permissions
Operation

This OS handles installing API hooks for logging, and general authentication. To do this, it overwrites several functions within the FS API, the RS/Redstone API, the HTTP API, the Rednet API, and shell.run. It also implements its own API.


The functions that have been replaced still do what they do normally, but with a few things added:

The FS API checks to see if a program is attempting to modify a protected folder, and blocks attempts to modify said folders.

Some functions (particularly those that can damage a computer) are logged. For example, all file operations are logged.


All users have home folders. This folder is placed at the root level, and it has their name. For example, a user named "example" would have a folder called "example" placed at the root level.

All users also recieve "user settings" folders, where applications can place user-specific settings, and is located at "os/userSettings/[user]"


Speaking of users, this OS provides applications a way to switch users, check passwords, run programs as root, and etc.


Custom APIs can be installed in "apis/" to be loaded at startup, and startup files are run from "modules/".

APIs and Modules are loaded in alphabetical order.


When run from a turtle, MuSeOS can stop programs from moving the turtle, breaking blocks, placing blocks, and retrieving items.

This behavior can be enabled/disabled by running the "turtleSettings" program, and programs running as root have full permissions.


Programs

This OS also has programs that use functionality listed above.

These are located in "bin/".


man - Shows the manual for the programs added by MuSeOS.

logViewer - Allows root to view logs. Must be run as root.

sudo - Allows normal users to run programs as root.

su - Allows users to switch users on the fly.

addUser - Adds a user. Must be run as root.

systemInfo - Lists computer id, label, and MuSeOS version. If run as root, also shows logfile size.

whoami - Lists the current user and his/her userid.

protect - Protects a folder. Must be run as root, and requires a reboot to complete changes.

delUser - removes a user, his/her user settings, and his/her home folder.

changePassword - changes a user's password. Must be run as root.

updater - Updates MuSeOS to the latest version, if you're running a version that's not up-to-date.

turtlesettings - Changes turtle permissions.

backup - makes a full backup of all files on a computer and saves it to a disk for easy restoration.


API

As stated before, this OS also provides an API for those who want to utilize the functionality of this OS:


museOS.switchUser(string target, string password)

Checks to see if target's password is the same as the one provided, and if so, switches the user.


museOS.sudo(string password, string program, args)

Functions identically to shell.run, but runs programs as root.


museOS.getUserID()

Returns the userid of the current user


museOS.authenticate(string user, string password)

Checks to see if user's password is the same as the one provided.


museOS.getCurrentUser()

Returns the current user's username.


Credits

I'd like to give credit to whoever wrote the default shell, as I used some of his code for my own command parser.


Installation

MuSeOS's installation program can be found on pastebin with code:


X1vAJAud


It is highly recommended to run this off of a floppy disk.

It is also recommended to wipe the computer's hard drive before installing, and the installer will ask if you want to do so.

If you don't want to do that, simply ensure that there isn't a startup file already in place on the target computer.


Notes/Tips
  • Don't lose your root password. You'll need it to run sudo.
  • Don't give your root password out to people you don't trust.
  • Don't run untrusted programs as root.
  • We have folder protection for a reason.
That's all for now!
Shazz #2
Posted 15 September 2012 - 06:24 PM
I was planning on making an OS like this which prevents people from accessing certain files, etc. I will try this out when I get access to my desktop.