LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 09-20-2012, 01:41 PM   #1
sangal_ak04
LQ Newbie
 
Registered: Sep 2008
Posts: 27

Rep: Reputation: 0
Question Restricting multiple username password prompts - Linux Mercurial Keyring extension


Hi

I'm working on in setting up Mercurial Version control DVCS tool on Linux machine. It's done. When I go to http://serverort/hg

the link is working and whatever repositories I have created are visible and working fine.

Now, as a developer, when I access Mercurial repositories for doing development, like do "hg clone (checkout), hg commit, hg push etc).. I get prompted every time to provide my Active Directory/LDAP credentials when I do such operations.

I found mercurial can be configured with a plugin called "mercurial_keyring" and then, it'll just prompt the user his/her username/password (Active Directory / LDAP) for the first time and until that session remains, user can do any Hg/Mercurial development operations.

Does anyone have any information what file/setting I should change to make this happen correctly. So far, I have configured it per the online "mercurial_keyring" installation procedures but with no luck.

Following is my Linux user's ~/.hgrc file:
==========================================
Code:
[ui]
username=c123456 <Arun.Sangal@MyCompany.com>

[extensions]
mercurial_keyring = /root/mercurial_keyring.py

#[trusted]
#users = *
#groups = *

[extensions]
acl =
bugzilla =
children =
churn =
color =
convert =
eol = !
extdiff =
factotum = !
fetch =
gpg =
graphlog =
hgcia =
hgcr-gui-qt = !
hgk =
highlight =
interhg =
keyword =
largefiles = !
mercurial_keyring =
mq =
notify =
pager =
patchbomb =
perfarce = !
progress =
projrc = !
purge =
rebase =
record =
relink =
schemes =
.... ........etc

--------------------------------------------



My local Linux folder "Giga" where I hg cloned a repository has the following hgrc file contents inside: ../../Giga/.hg/hgrc):

---------------------------------------------

Code:
[paths]
default = http://the.hg.server.com/hg/TestHgRepo1/
myrepo = http://the.hg.server.com/hg/TestHgRepo1/

[auth]
myrepo.schemes = http https
myrepo.prefix = the.hg.server.com/hg
myrepo.username = c123456
---------------------------------------------

Any help.

Last edited by sangal_ak04; 09-20-2012 at 04:34 PM.
 
Old 01-10-2013, 08:02 PM   #2
sangal_ak04
LQ Newbie
 
Registered: Sep 2008
Posts: 27

Original Poster
Rep: Reputation: 0
Wink

1. Follow this link: http://pypi.python.org/pypi/mercurial_keyring

It's not that clear, but here's the main point.

when the above link says... use myremote, that means, while doing hg clone http://..../../repo1 <aliasname>
the aliasname MUST be given so that it'll checkout/clone your repo1 as "aliasname" given. then, there are 2 choices,

either update your local (instead of actual repository's .hg/hgrc file, NOTE this is different file that ~/.hgrc) --- or just update ~/.hgrc with the following lines


Quote:
[auth]
myremote.schemes = http https
myremote.prefix = ServerName/hg
myremote.username = c149807





1. NOTE NOTE:
1. While running "hg clone http://ServerName/some/hg/path/repos/Repository123" you have to provide another parameter, <aliasname> for the cloned "Repository123" folder/repository i.e.

hg clone http://ServerName/some/hg/path/repos/Repository123 myremote

what the above command will do is.. it'll checkout/clone Repository123 as "myremote" on the folder location from where you ran the above command. NOBODY mentioned this in the MERCURIAL KEYRING documentation clearly.

Now,

change some file.
do: hg stat
do: hg commit -m "somecomments"
(if you dont do this and do hg out/push directly, you'll see an error "No changes found")
do: hg out
do: hg push

NOW, NO MORE Multiple prompts for user authentication by Mercurial LDAP authentication at the prompt or in TortoiseHg.


2. NOTE NOTE: Make sure whatever ServerName you use, either just
ServerName
or
ServerName.company.com
or
ServerName.domain.company.com
or
xx.xx.xx.xx
i.e. Server's IP, in the hg clone command, you have to make sure that the value you'll put in ~/.hgrc (home directory's .hgrc file, which is different than repository's local .hg/hgrc file)... should have the 2nd line (value for remote server) as the same value that you used during clone command 1st parameter (http://<servervalue>)

Quote:
[auth]
myremote.schemes = http https
myremote.prefix = ServerName/hg
myremote.username = c149807
or

Quote:
[auth]
myremote.schemes = http https
myremote.prefix = ServerName.company.com/hg
myremote.username = c149807
or

Quote:
[auth]
myremote.schemes = http https
myremote.prefix = ServerName.domain.company.com/hg
myremote.username = c149807
or

Quote:
[auth]
myremote.schemes = http https
myremote.prefix = xx.xx.xx.xx/hg
myremote.username = c149807

otherwise, MERCURIAL KEYRING extension won't work.


easy peasy !!

Last edited by sangal_ak04; 01-10-2013 at 08:07 PM.
 
Old 01-16-2013, 11:43 AM   #4
sangal_ak04
LQ Newbie
 
Registered: Sep 2008
Posts: 27

Original Poster
Rep: Reputation: 0
if prompted multiple times for user credentials in mercurial. Setup Mercurial_Keyring and then

this question comes which nobody explained in an easy way.

??? how to make the [auth] xx.prefix = servername/hg_or_something work for all repositories under servername/hg location either if I use servername, servername's IP or servername's FQDN ?

ANSWER: Arun • 2 minutes ago −

OK, I put this in ~/.hgrc (Linux/Unix -home directory's .hgrc hidden file) or Windows users %UserProfile%/mercurial.ini or %HOME%/mercurial.ini file.

[auth]
default1.schemes = http https
default1.prefix = hg_merc_server/hg
default1.username = c123456

default2.schemes = http https
default2.prefix = hg_merc_server.company.com/hg
default2.username = c123456

default3.schemes = http https
default3.prefix = 10.211.222.321/hg
default3.username = c123456

Now, I can checkout using either Server/IP/Server's FQDN.
 
  


Reply

Tags
authentication, credentials, keyring, mercurial, prompt


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
su prompts for a password when no such is set zealer Linux - Newbie 1 11-11-2010 05:14 PM
[SOLVED] How to configure kannel for multiple username and password amritesh Red Hat 2 08-13-2010 04:53 AM
(Samba 3.0.20) Vista prompts for username, XP prompts just for password Noffie Linux - Server 2 07-21-2008 10:26 AM
passwd prompts for new password only once when a short password is entered powah Linux - Security 0 09-19-2007 04:20 PM
SVN and Apache, multiple password prompts watsoncj Linux - Software 0 10-10-2005 01:36 PM


All times are GMT -5. The time now is 08:28 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration