PDA

View Full Version : user managment


RUMMY
July 12th, 2009, 08:37
how can I backup users and groups and then restore

SirDice
July 12th, 2009, 09:10
Backup /etc/passwd and /etc/pwd.db.

RUMMY
July 12th, 2009, 10:41
need I /etc/master.passwd /etc/group /home/* /var/mail/* ?

dennylin93
July 12th, 2009, 14:23
The file that saves the group is /etc/group. Since /etc/passwd is a shadowed version of /etc/master.passwd, is only shows "*" in place of the password hashes.

The directories under /home contain the files of users, and /var/mail contains the mail. Information such as groups, passwords, and usernames aren't saved in these directories, but sometimes there's important stuff you might want to backup.

RUMMY
July 12th, 2009, 19:10
The file that saves the group is /etc/group. Since /etc/passwd is a shadowed version of /etc/master.passwd, is only shows "*" in place of the password hashes.

The directories under /home contain the files of users, and /var/mail contains the mail. Information such as groups, passwords, and usernames aren't saved in these directories, but sometimes there's important stuff you might want to backup.

so how can I fully backup my users and than restore?

vivek
July 12th, 2009, 19:29
so how can I fully backup my users and than restore?

Use dump and restore command to backup /etc, /home, /var etc directory. If you just need those files use tar:
tar -cvf /path/to/backup.tar /etc/passwd /etc/master.passwd /etc/blah /home/you /home/me /var/mail

To restore use tar again:
cd /
tar -xvf /path/to/backup.tar
To get only /etc/passwd
tar -xvf /path/to/backup.tar /etc/passwd /etc/master.passwd /etc/group

RUMMY
July 12th, 2009, 22:09
I tried but not works, as I see whit that files I cant manage users. so how can I do that?

dennylin93
July 15th, 2009, 01:48
I don't really understand your previous post, but you have to be root in order to do these backups. Use su or sudo su to gain the proper permissions. The latter requires security/sudo.

There's also a nice howto about backups here: https://forums.freebsd.org/showthread.php?t=185