svnsync with source repository password - svnsync

The source repository (UTILITIES) has anon-access = none specified requiring a password to access it. A user has been setup svnsync = sourcepass to use for syncing.
But how to I tell svnsync the username and password?
SYNCUSER=svnsync
SRCPASS=sourcepass
DESTPASS=destpass
svnsync init --non-interactive \
--sync-username $SYNCUSER --sync-password $DESTPASS \
--no-auth-cache \
"file://path/to/UTILITIES" "svn://svn.company.com/UTILITIES"
If I run without --non-interactive, it will prompt me to login to the source repository.
Note: the reason for --non-interactive is because initialisation of the mirror is handled by a daemon.
See: http://svnbook.red-bean.com/en/1.7/svn.ref.svnsync.c.init.html

One option is to pre-cache authentication, which is what I am currently doing.
$ svn info svn://svn.company.com/UTILITIES
Username: svnsync
Password: sourcepass
Store password unencrypted (yes/no)? yes
svnsync can then access the repository in --non-interactive mode.

Related

NiFi - Not Seeing user/password in nifi-app.log

In Windows, I've downloaded, installed, and started NiFi 1.16.3.
However when it asks me for a User and Password, I don't see these in nifi-app.log.
Is there a default User/Password?
Thanks
John
if you are on linux just run this command to set custom user/password for single user nifi:
cd <nifi_root_folder>
./bin/nifi.sh set-single-user-credentials <username> <password>
for windows there is a workaround to set custom credentials:
cd <nifi_root_folder>
java -cp conf;lib\bootstrap\* -Dnifi.properties.file.path=conf/nifi.properties ^
org.apache.nifi.authentication.single.user.command.SetSingleUserCredentials ^
<username> <password>
if you start a plain new nifi instance you will find the username and password in logs/nifi-app.log.
somewhere should be printed a line like this:
Generated Username [ae7b6dd8-bc89-44b0-a025-abe1230e6327]
Generated Password [DPwOASAEiXKHKAtR6CuzfNrRIVH+iU4o]

Samba 4.9.1 Password sync with CentOS7 root Password

What I NEED
Change root's password by using passwd
samba password sync with root new password, automatically.
P.S. Change from CentOS password to Samba password, but NOT the opposite.
Base Environment
OS: CentOS7
Samba Version: 4.9.1
Deployment: Source Compilation
Source Compilation of Samba
chmod 777 samba-4.9.1.tar.gz
tar -zxf samba-4.9.1.tar.gz
cd samba-4.9.1
./configure --without-ad-dc --sbindir=/usr/sbin/ --sysconfdir=/etc/samba/ --mandir=/usr/share/man/
make -j 4
sudo make install
P.S. No AD DC, No LDAP Password
smb.conf
[global]
workgroup = WORKGROUP
security = user
passdb backend = tdbsam
server signing = mandatory
client signing = required
[chenjian]
comment = CHENJIAN Directories
path = /home/chenjian
guest ok = no
browseable = yes
writable = yes
What I had TRY
samba sync password with unix password on debian wheezy
Neither libpam-winbind or libpam-smbpass can be found in CentOS7;
Change the file of /etc/pam.d/system-auth, like:
password requisite** pam_unix.so nullok obscure min=4 max=8 md5
password required pam_smbpass.so nullok use_authtok try_first_pass
but there is NO pam_smbpass.so in CentOS7 after souce compiling.
Encrypted Passwords
By using the shell of samba-4.9.1/source3/script/mksmbpasswd.sh
smb.conf using passdb backend = smbpasswd
Add smb passwd file = /etc/samba/smbpasswd
But,
HOW to change the file of smbpasswd automatically?
There is NO pam_smbpass.so, either.

How to do svn update without password on crontab

I'm new to svn and ssh. I'm trying to do svn update of 5 repositories in my local system every 3 hours on crontab.
So, to achieve this I have setup ssh passwordless login using the below steps:
ssh-keygen
ssh-copy-id -i ~/.ssh/id_rsa.pub test#repo.test.in
I did ssh test#repo.test.in
Till here it works fine for me. I'm able to login without password.
But, when I try to do sudo svn update on the 5 repositories, it is propmpting for password.
How to make svn update without password. Is there any way that I can do update of the repositories every 3 hours on cron.
I referred to this, but could not get it.
I'm using
`Ubuntu version : Ubuntu 13.04`
OpenSSH_6.1p1 Debian-4, OpenSSL 1.0.1c 10 May 2012
I can tell you two ways of passing passwords to SVN scripts
You can use expect Click here
or
--non-interactive --no-auth-cache --username XXXX --password YYYY
Check Documentation here

password authentication failed for user "postgres" on mac

I have problem creating new psql user because I cannot log in psql as "postgres", I have tried
1. sudo -u postgres psql
2. sudo -u postgres createuser img_site -P -s -e
and they are all ask for password of "postgres" which I don't know. I have tried to change unix password of user "postgres"(I know it's dangerous) and it still tells me: password authentication failed for user "postgres". I also have tried GUI pgAdmin but it's the same error.
I don't know if it's related: I have created a symbolic link
sudo ln -s /private/tmp/.s.PGSQL.5432 /var/pgsql_socket/
in order to get rid of error
createuser: could not connect to database postgres: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?
Check pg_hba.conf. it should have a line like this at the top (before all other entries):
local all postgres peer
This allows local Unix-domain socket access by postgres db user to all databases with no password required.
Now clear and redefine the password for postgres system user (which is automatically created during PostgreSQL installation):
sudo passwd -d postrges
sudo su postgres -c passed
The special thing about this user account is that postgres server allows it to connect to the database, no questions asked.
Now, to define an explicit password for postgres db user using which you can login via other means than local Unix-domain socket connection, run:
su postgres -c psql template1
psql> ALTER USER postgres WITH PASSWORD '<password>';
You will be asked for the postgres system user account password before this command can be run. On successful completion, type \q to quit psql shell, and you are done with resetting the password for postgres db user.
sudo doesn't want the password of the account you're switching to, it wants the password of the account you're switching from. It also requires that you be an admin (or otherwise listead in /etc/sudoers). su, on the other hand, requires the password for the account you're switching to.
I was trying to setup postgres for Ruby on Rails and I was getting the the password authentication failed for user error. Check if the server is actually running:
pg_ctl -D /usr/local/var/postgres status
If you get
pg_ctl: no server running
Run
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
Also you must include localhost in psql.
psql -U postgres -h localhost
This worked for me:
ALTER USER my_user WITH PASSWORD 'my_password';
I tried a lot of different tricks on my Macbook. And here is the one which helped me.On the screen, right click PostgreSQL14 for 'properties', then in 'connection' tab try to change port number from 5432 to 5433(or vise versa) -> save. And try to open again, for password use "postgres". Should work

How to fill in proxy information in cntlm config file?

Cntlm is an NTLM / NTLM Session Response / NTLMv2 authenticating HTTP proxy intended to help you break free from the chains of Microsoft proprietary world.
I have my proxy URL in the following format:
http://user:passwords#my_proxy_server.com:80
And I have to provide this information to cntlm. Its config file cntlm.ini has following structure and parameters:
Username
Domain
Password
Proxy
I am not sure, how to break up my original proxy property to fill these four options?
Update your user, domain, and proxy information in cntlm.ini, then test your proxy with this command (run in your Cntlm installation folder):
cntlm -c cntlm.ini -I -M http://google.ro
It will ask for your password, and hopefully print your required authentication information, which must be saved in your cntlm.ini
Sample cntlm.ini:
Username user
Domain domain
# provide actual value if autodetection fails
# Workstation pc-name
Proxy my_proxy_server.com:80
NoProxy 127.0.0.*, 192.168.*
Listen 127.0.0.1:54321
Listen 192.168.1.42:8080
Gateway no
SOCKS5Proxy 5000
# provide socks auth info if you want it
# SOCKS5User socks-user:socks-password
# printed authentication info from the previous step
Auth NTLMv2
PassNTLMv2 98D6986BCFA9886E41698C1686B58A09
Note: on linux the config file is cntlm.conf
The solution takes two steps!
First, complete the user, domain, and proxy fields in cntlm.ini. The username and domain should probably be whatever you use to log in to Windows at your office, eg.
Username employee1730
Domain corporate
Proxy proxy.infosys.corp:8080
Then test cntlm with a command such as
cntlm.exe -c cntlm.ini -I -M http://www.bbc.co.uk
It will ask for your password (again whatever you use to log in to Windows_). Hopefully it will print 'http 200 ok' somewhere, and print your some cryptic tokens authentication information. Now add these to cntlm.ini, eg:
Auth NTLM
PassNT A2A7104B1CE00000000000000007E1E1
PassLM C66000000000000000000000008060C8
Finally, set the http_proxy environment variable in Windows (assuming you didn't change with the Listen field which by default is set to 3128) to the following
http://localhost:3128
Without any configuration, you can simply issue the following command (modifying myusername and mydomain with your own information):
cntlm -u myusername -d mydomain -H
or
cntlm -u myusername#mydomain -H
It will ask you the password of myusername and will give you the following output:
PassLM 1AD35398BE6565DDB5C4EF70C0593492
PassNT 77B9081511704EE852F94227CF48A793
PassNTLMv2 A8FC9092D566461E6BEA971931EF1AEC # Only for user 'myusername', domain 'mydomain'
Then create the file cntlm.ini (or cntlm.conf on Linux using default path) with the following content (replacing your myusername, mydomain and A8FC9092D566461E6BEA971931EF1AEC with your information and the result of the previous command):
Username myusername
Domain mydomain
Proxy my_proxy_server.com:80
NoProxy 127.0.0.*, 192.168.*
Listen 127.0.0.1:5865
Gateway yes
SOCKS5Proxy 5866
Auth NTLMv2
PassNTLMv2 A8FC9092D566461E6BEA971931EF1AEC
Then you will have a local open proxy on local port 5865 and another one understanding SOCKS5 protocol at local port 5866.
Here is a guide on how to use cntlm
What is cntlm?
cntlm is an NTLM/NTLMv2 authenticating HTTP proxy
It takes the address of your proxy and opens a listening socket, forwarding each request to the parent proxy
Why cntlm?
Using cntlm we make it possible to run tools like choro, pip3, apt-get from a command line
pip3 install requests
choco install git
The main advantage of cntlm is password protection.
With cntlm you can use password hashes.
So NO PLAINTEXT PASSWORD in %HTTP_PROXY% and %HTTPS_PROXY% environment variables
Install cntlm
You can get the latest cntlm release from sourceforge
Note! Username and domain
My username is zezulinsky
My domain is local
When I run commands I use zezulinsky#local
Place your username when you run commands
Generate password hash
Run a command
cntlm -u zezulinsky#local -H
Enter your password:
Password:
As a result you are getting hashed password:
PassLM AB7D42F42QQQQ407552C4BCA4AEBFB11
PassNT PE78D847E35FA7FA59710D1231AAAF99
PassNTLMv2 46738B2E607F9093296AA4C319C3A259
Verify your generated hash is valid
Run a command
cntlm -u zezulinsky#local -M http://google.com
Enter your password
Password:
The result output
Config profile 1/4... OK (HTTP code: 301)
----------------------------[ Profile 0 ]------
Auth NTLMv2
PassNTLMv2 46738B2E607F9093296AA4C319C3A259
------------------------------------------------
Note! check that PassNTLMv2 hash is the same
The resulting hash is the same for both commands
PassNTLMv2 46738B2E607F9093296AA4C319C3A259
Change configuration file
Place generated hashes into the cntlm.ini configuration file
C:\Program Files (x86)\Cntlm\cntlm.ini
Here is how your cntlm.ini should look like
Username zezulinsky
Domain local
PassLM AB7D42F42QQQQ407552C4BCA4AEBFB11
PassNT PE78D847E35FA7FA59710D1231AAAF99
PassNTLMv2 46738B2E607F9093296AA4C319C3A259
Proxy PROXYSERVER:8080
NoProxy localhost, 127.0.0.*
Listen 3128
Note! newline at the end of cntlm.ini
It is important to add a newline at the end of the cntlm.ini configuration file
Set your environment variables
HTTPS_PROXY=http://localhost:3128
HTTP_PROXY=http://localhost:3128
Check that your cntlm works
Stop all the processes named cntlm.exe with process explorer
Run the command
cntlm -u zezulinsky#local -H
The output looks like
cygwin warning:
MS-DOS style path detected: C:\Program Files (x86)\Cntlm\cntlm.ini
Preferred POSIX equivalent is: /Cntlm/cntlm.ini
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
section: local, Username = 'zezulinsky'
section: local, Domain = 'local'
section: local, PassLM = 'AB7D42F42QQQQ407552C4BCA4AEBFB11'
section: local, PassNT = 'PE78D847E35FA7FA59710D1231AAAF99'
section: local, PassNTLMv2 = '46738B2E607F9093296AA4C319C3A259'
section: local, Proxy = 'PROXYSERVER:8080'
section: local, NoProxy = 'localhost, 10.*, 127.0.0.*
section: local, Listen = '3128'
Default config file opened successfully
cntlm: Proxy listening on 127.0.0.1:3128
Adding no-proxy for: 'localhost'
Adding no-proxy for: '10.*'
Adding no-proxy for: '127.0.0.*'
cntlm: Workstation name used: MYWORKSTATION
cntlm: Using following NTLM hashes: NTLMv2(1) NT(0) LM(0)
cntlm: PID 1234: Cntlm ready, staying in the foreground
Open a new cmd and run a command:
pip3 install requests
You should have requests python package installed
Restart your machine
Congrats, now you have cntlm installed and configured
Just to add , if you are performing a "pip" operation , you might need to add and additional "--proxy=localhost:port_number"
e.g pip install --proxy=localhost:3128 matplotlib
Visit this link to see full details.
Once you generated the file, and changed your password, you can run as below,
cntlm -H
Username will be the same. it will ask for password, give it, then copy the PassNTLMv2, edit the cntlm.ini, then just run the following
cntlm -v
Thank you Sasha Zezulinsky.
In windows:
I used
SET HTTPS_PROXY=http://localhost:3128
When it was set to
SET HTTPS_PROXY=http://127.0.0.1:3128, it never worked.
Below posts are also very helpful.
How to use pip on windows behind an authenticating proxy
For me just using cntlm -H wasn't generating the right hash, but it does with the command below providing the user name.
If you need to generate a new password hash for cntlm, because you have change it or you've been forced to update it, you can just type the below command and update your cntlm.conf configuration file with the output:
$ cntlm -u test -H
Password:
PassLM D2AABAF8828482D5552C4BCA4AEBFB11
PassNT 83AC305A1582F064C469755F04AE5C0A
PassNTLMv2 4B80D9370D353EE006D714E39715A5CB # Only for user 'test', domain ''

Resources