added some programs for using the user system

This commit is contained in:
Izaya 2017-09-14 15:15:08 +10:00
parent 7b38b1286f
commit 4477b2769c
2 changed files with 9 additions and 0 deletions

4
exec/passwd.lua Normal file
View File

@ -0,0 +1,4 @@
local tA = {...}
local s=os.gensalt(16)
io.write("New password for "..tA[1]..": ")
os.setuser(tA[1],sha.sha256(io.read("*")..s),s)

5
exec/su.lua Normal file
View File

@ -0,0 +1,5 @@
local tA = {...}
local s=os.gensalt(16)
io.write("Password for "..tA[1]..": ")
local res = os.su(tA[1],io.read("*"))
if not res then print("Failed.") end