The fs API is definitely what you're looking for here. Consider this to be at the start of your program:
local file = fs.open("/password","r")
local password = file.read()
file.close()
Line by line explanation:
1. Opens the "/password" file (/ means root directory), with the parameter "r" meaning "read mode", allowing you to read the contents
2. This sets the variable "password" to the contents of the file
3. Closes the file, saying you're finished with it. If you don't do this you will have errors later and won't be able to open/close the file again until you reboot the computer.
Consider this to be where you want to have a new password:
local newPassword = read("*")
local file = fs.open("/password","w")
file.write(newPassword)
file.close()
Line by line explanation:
1. Set "newPassword" to what the user puts in
2. Open the "/password" file (like before) except this time we're opening it with parameter "w", meaning "write mode", allowing us to over-write what's currently in the file
3. Write the value of "newPassword" to the file
4. Close the file
I hope this helps you understand what the fs API does :)/>