I need a way to create an account that will delete itself when the system does a full poweroff, but not on a reboot or logout. It also needs to have a unique account name (not guest) and password.
Asked
Active
Viewed 85 times
1 Answers
2
sudo adduser newuser
It will ask for password of newuser.
Create a bash script, for example: deleteuser.sh
Script:
#!/bin/sh
deluser --remove-all-files newuser
To execute a script at shutdown
- Put your script in
/etc/rc0.d
- Make it executable (
sudo chmod +x deleteuser.sh
) - Note: The scripts in this directory are executed in alphabetical order

mertyildiran
- 1,956
- 2
- 17
- 21
/etc/rc0.d
– mertyildiran Jan 31 '15 at 05:42