3 Ways shown below to access svn via ssh
1. svn+ssh://rprajapa@ora-rbtdev-app.xyz.com/appdata/rbt/repo/rakeshP17n_lastrel
svn+ssh with putty
2. svn+ssh://[username]@[putty saved session name]/path/to/repository
or
3. svn+ssh://[putty saved session name]/path/to/repository
I was facing problems in accessing the repository with above methods.
- I am on a windows machine using Tortoise svn to access the repo on a REDHAT box
- My Putty pageant had loaded the private key to the server successfully..
- I put in the third url method above in the Repo Browser of TortoiseSvn ([] brackets indicate substitute the value there and do not include the brackets itself)
- The repo exists and the path is correct
The main Issue)
svn command is not in $PATH.
TortoiseSVN runs a non interactive shell to connect to server just like the command below
ssh rprajapa@ora-rbtdev-app.xyz.com "svn"
The above command gave the error "svn command not found"
Solution 1)
When we login in interactively svn command is found
but
for non interactive shell it does not find the command
(some pointers here for why this is so: http://stackoverflow.com/questions/216202/why-does-an-ssh-remote-command-get-fewer-environment-variables-then-when-run-man )
Since TortoiseSvn uses non interactive shell way of accessing the repo .. we simply need to add
PATH to .bashrc
file contents pasted below
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific aliases and functions
export PATH=$PATH:/opt/ubersvn/bin
Solution 2) Using "ssh forced commands"
Modify the ssh key to include the following at the beginning of the key for example
(substitute your path to svnserve below and also tunner-user)
command="/opt/ubersvn/bin/svnserve -t --tunnel-user=rprajapa" ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIBiSfTZ9GVSl4XbSZqaCne6F48HgeSL3AJHDphNzOcTjM9t3WYccDfU7OXkv1dZerISvOSE/Eg+N/0/Ur2QMJpaciknY+LQ== rprajapa
This works for the purposes of TortoiseSvn but it has one drawback.. you cannot use this key to login to server interactively
you will get the following message
( success ( 2 2 ( ) ( edit-pipeline svndiff1 absent-entries commit-revprops depth log-revprops partial-replay ) ) )
1. svn+ssh://rprajapa@ora-rbtdev-app.xyz.com/appdata/rbt/repo/rakeshP17n_lastrel
svn+ssh with putty
2. svn+ssh://[username]@[putty saved session name]/path/to/repository
or
3. svn+ssh://[putty saved session name]/path/to/repository
I was facing problems in accessing the repository with above methods.
- I am on a windows machine using Tortoise svn to access the repo on a REDHAT box
- My Putty pageant had loaded the private key to the server successfully..
- I put in the third url method above in the Repo Browser of TortoiseSvn ([] brackets indicate substitute the value there and do not include the brackets itself)
- The repo exists and the path is correct
The main Issue)
svn command is not in $PATH.
TortoiseSVN runs a non interactive shell to connect to server just like the command below
ssh rprajapa@ora-rbtdev-app.xyz.com "svn"
The above command gave the error "svn command not found"
Solution 1)
When we login in interactively svn command is found
but
for non interactive shell it does not find the command
(some pointers here for why this is so: http://stackoverflow.com/questions/216202/why-does-an-ssh-remote-command-get-fewer-environment-variables-then-when-run-man )
Since TortoiseSvn uses non interactive shell way of accessing the repo .. we simply need to add
PATH to .bashrc
file contents pasted below
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific aliases and functions
export PATH=$PATH:/opt/ubersvn/bin
Solution 2) Using "ssh forced commands"
Modify the ssh key to include the following at the beginning of the key for example
(substitute your path to svnserve below and also tunner-user)
command="/opt/ubersvn/bin/svnserve -t --tunnel-user=rprajapa" ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIBiSfTZ9GVSl4XbSZqaCne6F48HgeSL3AJHDphNzOcTjM9t3WYccDfU7OXkv1dZerISvOSE/Eg+N/0/Ur2QMJpaciknY+LQ== rprajapa
This works for the purposes of TortoiseSvn but it has one drawback.. you cannot use this key to login to server interactively
you will get the following message
( success ( 2 2 ( ) ( edit-pipeline svndiff1 absent-entries commit-revprops depth log-revprops partial-replay ) ) )
and it will stay there and you will not get a $ prompt.
No comments:
Post a Comment