Is there a way to configure TortoiseHg to store my password?
I have a project hosted on Google Code that I access using TortoiseHg. Whenever I want to push changes to Google Code TortoiseHg prompts me for a username and password. Google Code requires me to use an auto-generated password, and it gets quite repetitive to look it up every time.
Both existing answers suggest storing your username and password unencrypted in plain-text, which is a bit of a no-no.
You should use the Keyring extension instead, as it has been specifically designed for securely saving authentication passwords. It already comes bundled with TortoiseHg, so all you have to do is activate it by writing the following in your mercurial.ini file:
[extensions]
mercurial_keyring=
You will also have to associate your username with the push url by editing your repository-specific .hg\hgrc file like in the example below:
[paths]
default = https://<your_username>#bitbucket.org/tortoisehg/thg
For more details on associating your username with the url, see the Repository Configuration (SMTP) section of the Keyring extension page.
Three steps, watch screenshot.
Note: This stores your password in plaintext.
Security warning
Although this answer is accepted as of 2017-09-15, it is not a recommended solution. You should never store your passwords in plain text. Use the mercurial_keyring extension instead. See another answer here.
You can change your push URL to https://username:password#hostname.com/repo.
This is explained in Google Code's and Mercurial's FAQs.
EDIT: Mercurial FAQ explains another way to do it:
With Mercurial 1.3 you can also add an auth section to your hgrc file:
[auth]
example.prefix = https://hg.example.net/
example.username = foo
example.password = bar
If you want to configure it via TortoiseHg, Repository Setting dialog is available.
After opening the dialog, please switch to 'Sync' tab.
You can add a path with HTTPS auth information.
http://tortoisehg.bitbucket.io/manual/2.9/settings.html#module-web.settings
Simply modify the hgrc file in the .hg directory of your local repository so it looks like this:
[paths]
default = https://name:password#yourproj.googlecode.com/hg/
where name is your Google Code login without the gmail/googlemail bit e.g. 'fredb' (not fredb#gmail.com), password is the Google-generated password, and yourproj is the name of your GC project. So something like:
default = https://fred:xyz123#fredproj.googlecode.com/hg/
This works for me using SSH. I know the password it's in text plain, but this is not a problem in this project.
You have to change myUser and MyOPas for your credentials and the path to: TortoisePlink.exe.
Edit the mercurial.ini
[reviewboard]
password = myPass
[ui]
username = myUser
ssh = "C:\Program Files\TortoiseHg\lib\TortoisePlink.exe" -l myUser -pw myPass
If you want to store the password in mercurial.ini and it doesn't work anymore after you upgrade to TortoiseHg 4.9 or higher a possible solution is to add the port to the prefix:
[auth]
tax.prefix = http://server:8080
tax.username = cerveser
tax.password = mypassword
Related
I have added a key also.
I tried adding username and password in url as: root:password#ssh://10.10.14.119//home/pk/user_app.git.
I tried making file containing login and password and added that from windows 10 cmd prompt.
Nothing is working. Its asking password for every push and pull
Thanks all for your responses.
Finally I got the answer.
I used the global key (id_rsa.ppk) of my git server and its working very well now.
I forgot the master-password of my Glassfish 3.1.2.2. Is there a way to reset it? I spent a lot of time "googling around" but i didn't find a suitable answer.
There is a backup password that can be used to access the administrator panel even if you've forgotten the main one.
If you navigate to glassfish\domains\domain1\config\ you will find a file called local-password.
The contents of that file can be used as a password to log in to the control panel as admin.
Please follow the below steps:
Stop the domain
Back up the master password file
Create a new domain and save the master password:
asadmin create-domain --savemasterpassword domain2
Remember the password :-)
Copy the newly created masterpassword file over the old one
Delete the newly created domain:
asadmin delete-domain domain2
FYI, now you should also know why you want to protect the master password file using file permissions :-)
Copy the admin-keyfile from origin install zip (empty password).
This was a big problem for me after inheriting a testing VM from a colleague who left the company. I didn't want to risk creating a new domain as described above and I tried using the contents of local-password file as also described above, but that didn't work for me.
What did work first time was the following on GlassFish Server Open Source Edition 3.1.2.2 (build 5). Change contents of this file:
$GLASSFISH_HOME$\glassfish\domains\domain1\config\admin-keyfile
with:
admin;{SSHA}WQVj8i9CLECCiv+w6ZxGgMrcfPqHPoXZW+2Jdw==;asadmin
I didn't add a newline or carriage return at the end of the line.
This is my modification of an online solution.
For Glassfish 4, after creating domain2 with default passwords, I also had to copy keystore.jks and domain-passwords files along with the master-password before change-master-password would recognise the password.
I have a HTTP server with some Mercurial repositories; in which I handle digest authentication, and I found myself pushing changes to the server too often, so, I wanna know If is there any way to send the credentials (user and password) along with the hg push command?
Thanks
Please use the auth section in your hgrc file. That will let you write things like:
[auth]
bb.prefix = https://bitbucket.org/
bb.username = mg
bb.password = something
With http authentication, I use hg push https://user:password#url.com in hgrc file, not sure if it helps here.
TortoiseHg 0.9.3 is the first version to include the mercurial_keyring extension, and I'm quite happy with it. The previous link shows the required configuration to make it work.
Mercurial 1.4.3 doesn't include it, but I hope it's just a matter of time before it will be available as a part of the Mercurial packages.
There is a default password extension to automatically provide credentials. There's not much advantage to this beyond embedding the creds right in the url as Sejanus suggests. It's still plaintext, but does put your password into a separate file, the location of which you can control. Without this, the password is stored in the .hg folder in your workspace, so this might be preferable if the filesystem your workspace is on is shared.
I just moved my svn repository to a new server.
Previously I was accessing my repository via: svn://oldserver/yyy/zzz.
Now I want to access it via: https://newserver:8443/svn/yyy/zzz.
I used switch --relocate to re-point my source tree and this seemed to work well.
When I try to update the source I use:
svn.exe update zzz --username myusername --password mypassword --non-interactive
When I do it still asks me for the username and password (which if I re-enter works OK).
No matter what I do I can't get it to accept the username and password parameters.
Can anyone please help me out here?
I'm not really a SVN god, but I assume you got the checkout working? What happens if you just type
svn.exe update zzz
in the root directory of your project?
You may want to check the files under the %APPDATA%\Subversion\auth\ ($HOME/.subversion/auth in linux) folder and if there is an auth entry for this project, and edit or delete it as appropriate.
When you pass --username and --password, you're telling Subversion to ignore the cached username/passwords, and use those instead. There's probably an error in the username and/or password (maybe caused by your shell?)
I'd like to know how to get Subversion to change the name that my changes appear under.
I'm just starting to use Subversion. I'm currently using it to version control code on an XP laptop where I'm always logged in under my wife's name. I'd like the subversion DB to show the changes under my name.
Later on I'll replicate the DB so it is accessible to the whole house. My wife uses the office computer where she is always logged in under my name. I'll probably set it up so that it automatically checks in modified documents... preferably under her name.
Eventually I'll probably be using it from a linux machine under another username.
Is there some way to modify the user environment to change the user name that Subversion calls you? I'd expect something like setting SVN_USERNAME='Mark' which would override however it usually gets the name.
Update: It looks like the --username flag that Michael referred to does work to change the name reported by "svn stat", even for local file: repositories. In addition, it is sticky so you don't need to specify it for the next command. I even rebooted and it still used the "--username" value from my previous boot.
Most Subversion commands take the --username option to specify the username you want to use to the repository. Subversion remembers the last repository username and password used in each working copy, which means, among other things, that if you use svn checkout --username myuser you never need to specify the username again.
As Kamil Kisiel says, when Subversion is accessing the repository directly off the file system (that is, the repository URL is of form file:///path/to/repo or file://file-server/path/to/repo), it uses your file system permissions to access the repository. And when you connect via SSH tunneling (svn+ssh://server/path/to/repo), SVN uses your FS permissions on the server, as determined by your SSH login. In those cases, svn checkout --username may not work for your repository.
For svn over ssh try:
svn list svn+ssh://[user_name]#server_name/path_to_repo
svn will prompt you for the user_name's password.
You can setup a default username via ~/.subversion/servers:
[groups]
yourgroupname = svn.example.com
[yourgroupname]
username = yourusername
Please be aware that older versions of svn do not support it (e.g. 1.3.1 [sic!]).
"svn co --username=yourUserName --password=yourpassword http://path-to-your-svn"
Worked for me when on another user account. You will be prompted to enter username/password again though. You need to login like the above once and you are all set for the subsequent times(Unless you restart your machine).
If you need to specify a username other than your logged in user for use with svn+ssh just add an entry to your .ssh/config file:
Host example.com
User jdoe
Subversion usually asks me for my "Subversion username" if it fails using my logged in username. So, when I am lazy (usually) I'll just let it ask me for my password and I'll hit enter, and wait for the username prompt and use my Subversion username.
Otherwise, Michael's solution is a good way to specify the username right off.
Most of the answers seem to be for svn+ssh, or don't seem to work for us.
For http access, the easiest way to log out an SVN user from the command line is:
rm ~/.subversion/auth/svn.simple/*
Hat tip: http://www.yolinux.com/TUTORIALS/Subversion.html
Using Subversion with either the Apache module or svnserve. I've been able to perform operations as multiple users using --username.
Each time you invoke a Subversion command as a 'new' user, your $HOME/.subversion/auth/<authentication-method>/ directory will have a new entry cached for that user (assuming you are able to authenticate with the correct password or authentication method for the server you are contacting as that particular user).
I believe if you use the file:// method to access your subversion repository, your changes are always performed under the user which accesses the repository. You need to use a method that supports authentication such as http:// or svn://.
See http://svnbook.red-bean.com/en/1.5/svn-book.html#svn.serverconfig.choosing
If you are using svn+ssh to connect to the repository then the only thing that authenticates you and authorizes you is your ssh credentials. EVERYTHING else is ignored. Your username will be logged in subversion exactly as it is established in your ssh connection. An excellent explanation of this is at jimmyg.org/blog/2007/subversion-over-svnssh-on-debian.html
Go to ~/.subversion/auth/svn.simple/*, and you will see a list of files that contains the information about your svn user account. Just delete all others that you don't need.
After that, when you do anything that regards to SVN operation, such as commit, rm, etc,. You will be prompt again to enter username or passwords.
TortoiseSVN always prompts for username. (unless you tell it not to)
I believe you can set the SVN_USER environment variable to change your SVN username.