On Friday 26 December 2003 06:05 am, Andreas Winkelmann wrote:
Am Freitag, 26. Dezember 2003 11:04 schrieb Andreas Winkelmann:
I am using a program which can autheticate against /etc/shadow or against another file with the same structure. This requires that I be able to put the encrypted passwords in /usr/local/mydaemon/etc/shadow. However, I am at a loss at how I can use shadow utils to mainupulate passwords in a file other than /etc/* ones. Basically I need a program or a method where I can type: passwd -u myuser -p mypassword -f /usr/local/mydaemon/etc/shadow and similar for useradd and groupadd tools also. I checked the standard utils, and they dont let you change the files they are manipulating. (Probably compiled in). I dont want to recompile those tools either because this manipulation is for only one daemon anyways and I dont want to wreck my basic admin tools.
$ man chroot
Or there is a suse-tool. Normally it is for changing the password of a user from a batchfile. Look at chpasswd (8). This tool has an option to specify another ./etc-Path with -P.
Thanks to all. I ended up just doing authentication via a MYSQL database and using mysqlcc to edit the user entries. There I can keep the data in plaintext anyways. Im kinda disappointed theres not a tool that will dump an encrypted password to stdout given it in stdin. Although I suppose if I knew perl that would be a one/two liner im sure. ------------------------- Eric Bambach Eric at cisu dot net -------------------------