I have a Linux system with several users. I don't know their passwords, nor do I want to know them.
I have to do a batch copy of some of their directories over SSH, with their account and password.
My idea was to make a backup of /etc/shadow
, then alter it with new passwords for each user (one that I know, like "tmppass"), do my backups, then replace the /etc/shadow
file with the old one.
Will that work? If so, how do I generate the password/s? (The passwords are like $1$xxxxxx/xxxxx).
/etc/shadow
), you can just change the passwords with thepasswd
command (no need to modify the file). Backing up the shadow file, changing the passwords, doing the copying, and restoring the shadow file might work.passwd
, there's no way to put their old password back without asking them to change it.su - username
and "become" any other user - without being asked for password. I myself used that trick; and wrote a script that went through a list of the user on my system, "became" them, and then ran a little script as each of them.