LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 07-15-2006, 10:43 AM   #1
zWaR
Member
 
Registered: Dec 2003
Distribution: Slackware, Alpine Linux, Ubuntu, Debian
Posts: 219

Rep: Reputation: 35
Securing CVS with ssh tunneling


Hello!

I want to secure CVS communication with ssh tunneling. I've made a chroot jail, with help of cvsd and i'm trying to use ssh tunneling with help of a ssh key. In general the procedure is this:
1. make user 'cvsd' who has r/w access to the CVS repository
2. set 'cvsd's shell to /bin/bash (or some proper shell) in /etc/passwd
3. set 'cvsd's password to * in /etc/shadow
4. have all developers who are using the CVS generate an ssh key
5. put an entry in 'cvsd's /home/cvsd/.ssh/authorized_keys2 file that looks like:

The client, which wants to connect to the server must fist set CVS_RSH variable to /usr/bin/ssh (or where his ssh resides) and uses :ext for cvs connection, e.g. cvs -d :ext:user@host:/cvsroot checkout module_name

The problem is, the ssh connection to the server does not use the standard port 22 for connection, but port number 22022. How can i now connect to the server? Is there a ssh's system variable or a config file i should set to change the default port number?
 
Old 07-16-2006, 06:07 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,005
Blog Entries: 54

Rep: Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763
export CVS_CLIENT_PORT=22022
 
Old 07-16-2006, 03:05 PM   #3
zWaR
Member
 
Registered: Dec 2003
Distribution: Slackware, Alpine Linux, Ubuntu, Debian
Posts: 219

Original Poster
Rep: Reputation: 35
Unfortunately this is not working, because i use ssh for initial connection, not cvs. CVS traffic (using pserver protocol) is transferred throughout the ssh tunnel. I have to configure ssh somehow, not cvs. The external cvs shell is set to ssh, not to rsh (export CVS_RSH=ssh). I even tried to add ssh -p 22022 to CVS_RSH variable, but it's not working, i get this error msg:
cvs [checkout aborted]: cannot exec /usr/bin/ssh -p 22022: No such file or directory
(using the default ssh port 22 works though).

Maybe there is a similar variable like CVS_CLIENT_PORT for ssh??
 
Old 07-17-2006, 03:43 AM   #4
zWaR
Member
 
Registered: Dec 2003
Distribution: Slackware, Alpine Linux, Ubuntu, Debian
Posts: 219

Original Poster
Rep: Reputation: 35
I got one solution, i put this line into ~/.ssh/config:
Port 22022

And it works!
 
Old 07-17-2006, 04:19 AM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,005
Blog Entries: 54

Rep: Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763
I got one solution, i put this line into ~/.ssh/config:
Port 22022

Better confine that to the host-specific section of config or it'll be taken as default:
Host something.something
Port 22022
 
  


Reply

Tags
cvs, pserver, ssh


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
ssh-agent, ssh-add and ssh-keygen AND CVS raylpc Linux - General 2 11-19-2008 02:50 AM
tunneling thru ssh c9876543210 Linux - Networking 1 07-21-2005 12:45 AM
SSH tunneling X AzZuM Linux - Security 3 11-27-2004 01:59 AM
SSH Tunneling danny_beta_read Linux - Networking 0 06-10-2004 02:43 PM
tunneling with ssh barbanero Linux - Security 2 01-24-2002 10:53 AM


All times are GMT -5. The time now is 08:55 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