Re: [389-users] db2ldif as non root user

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





Rich Megginson wrote:
Mitja Mihelič wrote:
Greetings all fellow Fedora Directory Server users!


Is it possible to dump the database to an LDIF file as a non-root user ?

I have no problem doing this as root.

I would like to run
/usr/lib/dirsrv/slapd-example/db2ldif -a /tmp/dbdump.ldif -n userRoot
from a remote machine via ssh and I would really like to avoid connecting to the machine as root.

Has anyone had any experience in doing this if it is at all possible ?
You can also use the task interface to invoke this task via LDAP remotely. See /usr/lib/dirsrv/slapd-example/db2ldif.pl for more information.
Rich, I tried your suggestion and it worked.
Here is what I did to get it working :
- as root: chmod o+rx /usr/lib/dirsrv/slapd-example/db2ldif.pl
- as user: /usr/lib/dirsrv/slapd-example/db2ldif.pl -D "cn=Directory manager" -w secret -a /tmp/dbdump.ldif -n userRoot

This produced an LDIF dump as it should.
Since it was written by the ldapmodify command (if I am reading the script correctly) it is owned by nobody :
-rw------- 1 nobody nobody 136140945 Oct 13 09:34 dbdump.ldif
Of course now the dump cannot be read by the user that initiated the operation.

I failed to mention that after the dump is created, it is supposed to be copied (via scp) to the machine that initiated the dump.
The remote machine issues the following commands:
# ssh user@xxxxxxxxxxx /usr/lib/dirsrv/slapd-example/db2ldif.pl -D "cn=Directory manager" -w secret -a /tmp/dbdump.ldif -n userRoot
# scp user@xxxxxxxxxxx:/tmp/dbdump.ldif /home/user/dbdump.ldif

The only way I see around this problem is to let the server run as a user other than "nobody". Or is there another way ?

Regards,
Mitja

--
389 users mailing list
389-users@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-directory-users

[Index of Archives]     [Fedora Directory Users]     [Fedora Directory Devel]     [Fedora Announce]     [Fedora Legacy Announce]     [Kernel]     [Fedora Legacy]     [Share Photos]     [Fedora Desktop]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Big List of Linux Books]     [Gimp]     [Yosemite News]

  Powered by Linux