ldappaswordmodify doesn't accept -w - option - oracle

I use OpenDS package ( This is a very great LDAP soft) and I've got tiny problem with an option of ldappasswordmodify command
:~# ldappasswordmodify --version
OpenDS Directory Server 2.2.0
Build 20091123144827Z
--
Name Build number Revision number
Extension: snmp-mib2605 2.2.0 6181
~# ldappasswordmodify -h localhost -D "cn=Directory Manager" -w - -a "dn:uid=user,ou=People,dc=acme,dc=org"An error occurred while attempting to connect to the Directory Server: The
simple bind attempt failed
:~# ldappasswordmodify -h localhost -D "cn=Directory Manager" -w xxxxxxx -a "dn:uid=user,ou=People,dc=acme,dc=org"
The LDAP password modify operation was successful
Generated Password: F8F2R1W6V
I did research and I found this on the Oracle Site :
http://docs.oracle.com/cd/E19623-01/820-6171/ldappasswordmodify.html
-w, --bindPassword bindPassword
Use the bind password when authenticating to the directory server. This option can be used for simple authentication as well as password-based SASL mechanisms. This option must not be used in conjunction with --bindPasswordFile. To prompt for the password, type -w -.
What I did wrong?
Thank for your help.

I found this line working :
:~# read -s A ; ldappasswordmodify -h localhost -D "cn=Directory Manager" -w $A -a "dn:uid=user,ou=People,dc=acme,dc=org"
The LDAP password modify operation was successful
Generated Password: F8F2R1W6V
Thanks anyway

Related

How to use PGPASS file in Powershell to avoid password prompt?

I had to automate my postgre database backup. As instructed by my software vendor I am trying to use pg_dump.exe (see below) file to take a backup but that prompts me for password.
.\pg_dump.exe -h localhost -p 4432 -U postgres -v -b -F t -f "C:\Backup\Backup.tar" Repo
So googled and found that as per "https://www.postgresql.org/docs/9.6/libpq-pgpass.html" I can create a pgpass.conf file within 'C:\Users\User1\AppData\Roaming\postgresql\pgpass.conf" which I did.
Then I tried to pass data of pgpass.conf file to env variable before executing my pg_dump command. But it is not working. Still I am getting prompt to enter password. This is the content of pgpass.conf file: *:*:*:postgres:password
Below is the code I am trying in PowerShell,
$Env:PGPASSFILE="C:\Users\User1\AppData\Roaming\postgresql\pgpass.conf"
cd "C:\Program Files\Qlik\Sense\Repository\PostgreSQL\9.6\bin"
.\pg_dump.exe -h localhost -p 4432 -U postgres -v -b -F t -f "C:\Backup\Backup.tar" Repo
Why am I still being asked for password?
When I type following code $Env:AppData I get following response "C:\Users\User1\AppData\Roaming"
Everywhere there are guidance on how to use it in UNIX or command prompt but not in powershell. Any help is appreciated. Also if you could direct me how to secure this password file then it will be great.
With password prompt I cannot automate it with windows task scheduler.
I suspect you have a suitable solution, however, as a quick (and not secure) workaround via the command prompt, you can use the variable PGPASSWORD to hold the password then run the backup script.
A sample might be something like:
SET PGPASSWORD=password
cd "C:\Program Files\Qlik\Sense\Repository\PostgreSQL\9.6\bin" pg_dump.exe -h localhost -p 4432 -U postgres -b -F t -f "d:\qs_backup\QSR_backup.tar" QSR
Rod
I have yet to get the damned thing to work yet, but I did find this:
-w
--no-password Never issue a password prompt. If the server requires password authentication and a password is not available by other means
such as a .pgpass file, the connection attempt will fail. This option
can be useful in batch jobs and scripts where no user is present to
enter a password.
I don't see a -w parameter in your call to pg_dump
I used pg_hba file to allow connection "trust" this is riskier method but I had to get things done ASAP. Thank you for your time and effort

pg_restore ignores .pgpass and PGPASSWORD environment variable

I want to import a backup using pg_restore without a password prompt.
I tried several options but after I run the script it will always ask for a password. pg_dump is working but not pg_restore. I can run the pg_restore command if I enter my password but I want a passwordless command or at least I don't want to enter my password because the script has to work without user interaction.
What is working for me:
PGPASSWORD=xyz pg_dump -h localhost -U user -Fc database > ~/dump_prod.pgsql
What is NOT working
1.)
PGPASSWORD=xyz pg_restore -h localhost -d database -U user -W --clean --no-owner ~/dump_prod.pgsql
2.)
pg_restore --dbname=postgresql://user:pass#localhost:5432/db -W --clean --no-owner ~/dump_prod.pgsql
3.)
touch ~/.pgpass
echo "*:*:*:*:password > ~/.pgpass
chmod 0600 ~/.pgpass
pg_restore -h localhost -d db -U user -W --clean --no-owner ~/dump_prod.pgsql
any ideas?
Regards
As per the doc, -W will prompt for a password. -w will not
-w
--no-password
Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as
a .pgpass file, the connection attempt will fail. This option can be
useful in batch jobs and scripts where no user is present to enter a
password.
-W
--password
Force pg_restore to prompt for a password before connecting to a database.
The .pgpass file worked for me.
My setup:
I am restoring DB into the postgres instance running as Docker container.
The postgres instance is run using command:
docker run --name postgres_db -p 5432:5432 -e POSTGRES_PASSWORD=admin -d postgres:9.6
pg_restore is present but it is available as separate tool, outside docker setup.
The ~/.pgpass file entry looks like this:
localhost:5432:db_name:user:password
Where:
db_name is the target db name that one is going to restore.
user is the name of the user that is going to perform the restore - in my case an admin user. i.e. postgres user in the postgres instance.
password - admin user's password. i.e. admin

Couchbase Server on Mac: cbdocloader not installed

I have installed Couchbase Server 3.0 on Mac OSX 1.9.5 using the package from couchbase, installed using all defaults, and I am not able to locate cbdocloader in the expected folder
/Applications/Couchbase Server.app/Contents/Resources/couchbase-core/bin/tools
The only tools available are:
cbanalyze-core
vbucketkeygen
vbuckettool
I do not see any information about the deprecation of this tool or an alternative approach to load data.
You are looking in the wrong folder, it's in bin and not tools:
[user:~] $ /Applications/Couchbase\ Server.app/Contents/Resources/couchbase-core/bin/cbdocloader -h
Usage: cbdocloader [options] <directory>|zipfile
Example: cbdocloader -u Administrator -p password -n 127.0.0.1:8091 -b mybucket -s 100 gamesim-sample.zip
Options:
-h, --help show this help message and exit
-u Administrator Username
-p password Password
-b mybucket Bucket
-n 127.0.0.1:8091 Node address
-s 100 RAM quota in MB

Using ldapsearch with a server over ssl but no password

Our organization requires SSL for access to our ldap server. When I set up our LDAP server in Mac OS X's Contacts application, I am able to search just fine for people in our organization. However, using the command line app ldapsearch doesn't seem to work.
The problem is that our organization, while using SSL, does not require a username or a password. I can't seem to get ldapsearch to not require a password.
Here's the command I'm using:
ldapsearch -H ldaps://ldap.example.com -b "" -s base "objectclass=*"
SASL/DIGEST-MD5 authentication started
Please enter your password:
Here is the contents of my /etc/openldap/ldap.conf
HOST ldap.example.com
PORT 636
TLS_REQCERT never
Here are the settings that work just fine in Mac OS X's Contacts application, and don't require a username or password:
What's the correct ldapsearch concoction to use for this server?
You need the -x option. Try something like:
ldapsearch -x -H ldaps://ldap.example.com -b "ou=people,dc=examplelabs,dc=com" -s sub "objectclass=inetorgperson"

NCFTPPUT command problem

I using passive mode FTP command provide by NCFTP, Currently i want to pass a raw ftp command after file transferred. i found that got an option to do that:
ncftpput -u user -p password -X "rename 123.exe 1234.exe" host /path C:\123.exe
however, it is not working. It can put the file, but rename command not working.
Have anyone did that before?Pls help
-X use RAW FTP commands
Use the following syntax:
ncftpput -u user -p password -X "RNFR 123.exe" -X "RNTO 1234.exe" host /path/123.exe
It works with ncftls as well. It is more immediate if you what you have to do is just a rename without actually uploading anything on the FTP server.
(-W is like -X. The only difference is that it does the rename immediately after logging in)
Here is the syntax:
ncftpls -u name -p psw -W "RNFR FTPfolder/anotherFolder/OLDname.txt" -W "RNTO FTPfolder/anotherFolder/NEWname.txt" ftp://ftp.name.org

Resources