I have deleted a user account using the command userdel -r george.
It deleted that user with their files.
I need to restore that user and their files, is it possible? How can I achieve it?
Asked
Active
Viewed 8,523 times
0
terdon
- 98,183
- 15
- 197
- 293
George Ulahannan
- 89
- 1
- 7
- 17
1 Answers
1
Not easily, no. The files have been deleted, you will need to use a tool that can recover deleted files, there is no undo for this. For help on recovering deleted files, see this Q&A:
Recreating the user is the easy part:
adduser george
For future reference, user management should be done with adduser and deluser instead of useradd and userdel.