First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 138058
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Default Assignee for New Packages <maintainer-wanted@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: David Guerizec <david+gentoo@guerizec.net>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
sshproxy-0.4.ebuild net-proxy/sshproxy/sshproxy-0.4.ebuild text/plain David Guerizec 2006-06-26 08:22 0000 515 bytes Details
sshproxy-0.4.ebuild net-proxy/sshproxy/sshproxy-0.4.ebuild text/plain David Guerizec 2006-06-26 08:27 0000 924 bytes Details
sshproxyd.confd net-proxy/sshproxy/files/sshproxyd.confd text/plain David Guerizec 2006-06-26 08:28 0000 140 bytes Details
sshproxyd.initd net-proxy/sshproxy/files/sshproxyd.initd text/plain David Guerizec 2006-06-26 08:28 0000 688 bytes Details
sshproxy-0.4.ebuild sshproxy-0.4.ebuild text/plain Alin Năstac 2006-06-29 11:46 0000 1.49 KB Details
sshproxy.initd sshproxy.initd text/plain Alin Năstac 2006-06-29 11:47 0000 350 bytes Details
sshproxy-0.4.1.ebuild sshproxy-0.4.1.ebuild text/plain David Guerizec 2006-06-29 17:17 0000 1.21 KB Details
metadata.xml metadata.xml text/plain David Guerizec 2006-06-29 17:20 0000 1.75 KB Details
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 138058 depends on: Show dependency tree
Show dependency graph
Bug 138058 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)







View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2006-06-26 08:20 0000
Here is an ebuild for sshproxy.

sshproxy is an ssh gateway to apply ACLs on ssh connections.

Check the homepage for a more detailed description.

------- Comment #1 From David Guerizec 2006-06-26 08:22:24 0000 -------
Created an attachment (id=90186) [edit]
net-proxy/sshproxy/sshproxy-0.4.ebuild

The sshproxy ebuild

------- Comment #2 From David Guerizec 2006-06-26 08:27:34 0000 -------
Created an attachment (id=90187) [edit]
net-proxy/sshproxy/sshproxy-0.4.ebuild

sshproxy ebuild

------- Comment #3 From David Guerizec 2006-06-26 08:28:29 0000 -------
Created an attachment (id=90188) [edit]
net-proxy/sshproxy/files/sshproxyd.confd

the conf.d/sshproxyd file

------- Comment #4 From David Guerizec 2006-06-26 08:28:59 0000 -------
Created an attachment (id=90189) [edit]
net-proxy/sshproxy/files/sshproxyd.initd

the init.d/sshproxyd script

------- Comment #5 From Alin Năstac 2006-06-28 12:26:37 0000 -------
I have 2 problems with this package:
a) sshproxyd creates host key before switching to daemon user, which makes
id_dsa unreadable by the daemon.
b) I don't know how to convince sshproxyd (using file backend) to let me
connect on one of my servers. Whatever I do, it tries to connect as "admin"
instead the user I set. What exactly should I write in pwdb files? 

------- Comment #6 From David Guerizec 2006-06-28 14:04:59 0000 -------
(In reply to comment #5)
> I have 2 problems with this package:
> a) sshproxyd creates host key before switching to daemon user, which makes
> id_dsa unreadable by the daemon.

I didn't notice this behaviour, how did you start sshproxyd ?

> b) I don't know how to convince sshproxyd (using file backend) to let me
> connect on one of my servers. Whatever I do, it tries to connect as "admin"
> instead the user I set. What exactly should I write in pwdb files? 

<warning>
The file backend is insecure for now, because it will let any user to connect
to the proxy, and thus to any remote site you configured. This will change in
the future, but this backend is for testing purpose until then.
</warning>

That said, you can check this section of the documentation to set up a remote
site:

http://penguin.fr/sshproxy/documentation.html#file-backend-add-sites-and-users

Basically, all you have to do is to create a file named after your site's
symbolic name (which can be the fqdn if you want) in the .sshproxy/pwdb
(default location), and populate it with a [DEFAULT] section for the host part
data, and one or more [remote_user] section as shown in the documentation. All
the fields shown are mandatory.

Hope this helps.

David

------- Comment #7 From Alin Năstac 2006-06-28 22:13:10 0000 -------
I've configured the daemon using sshproxyd --wizard then I launched the service
running /etc/init.d/sshproxyd start. Unfortunately, the key was created with
root:root.

This documentation is the one I followed to configure my remote server like
this:
[DEFAULT]
ip = a.b.c.d
port = 22

[mrness]
mrness = my_pass

Still, the user used to connect on the remote host was admin, no matter if I
executed pssh technosoft.ro or pssh mrness@technosoft.ro.

------- Comment #8 From David Guerizec 2006-06-28 23:42:12 0000 -------
(In reply to comment #7)
> I've configured the daemon using sshproxyd --wizard then I launched the service
> running /etc/init.d/sshproxyd start. Unfortunately, the key was created with
> root:root.

this is weird since the key is created on first run after the daemon changes
user and bind to the listening socket...

> This documentation is the one I followed to configure my remote server like
> this:
> [DEFAULT]
> ip = a.b.c.d
> port = 22

in the [DEFAULT] section you have to put a line like this:
location = whatever you like 

> 
> [mrness]
> mrness = my_pass

the latter line must be:
password = my_pass

> Still, the user used to connect on the remote host was admin, no matter if I
> executed pssh technosoft.ro or pssh mrness@technosoft.ro.

is your pwdb file named technosoft.ro ?
did you correctly set the right environment variables for pssh to point to the
proxy:
SSHPROXY_HOST (defaults to localhost)
SSHPROXY_PORT (defaults to 2242)

can uou try with the following command line with the standard ssh client
(replace localhost with the name of the sever hosting the proxy):
ssh -tp 2242 localhost mrness@technosoft.ro

------- Comment #9 From Alin Năstac 2006-06-29 11:07:28 0000 -------
ssh -tp 2242 localhost mrness@technosoft.ro worked, but I have few suggestions:

a) use $USER or $LOGNAME in case $SSHPROXY_USER is empty, like this:
PROXY_USER=${SSHPROXY_USER}
if [[ -z "${PROXY_USER}" ]]; then
   if [[ -n "${USER}" ]]; then
      PROXY_USER=${USER}
   else
      PROXY_USER=${admin}
   fi
fi

b) ssh-keygen is launched as root because you used seteuid instead of
setreuid/setuid (the same goes for setegid).

------- Comment #10 From Alin Năstac 2006-06-29 11:46:04 0000 -------
Created an attachment (id=90453) [edit]
sshproxy-0.4.ebuild

Improved ebuild (sorry, I can test it only on x86).

------- Comment #11 From Alin Năstac 2006-06-29 11:47:42 0000 -------
Created an attachment (id=90455) [edit]
sshproxy.initd

Don't see why should we have configurable daemon user or pid file.

------- Comment #12 From Alin Năstac 2006-06-29 11:52:14 0000 -------
Another nice-to-have things would be:
 a) some concise info messages at the end of pkg_config, explaining how to add
entries for the 2 backends available
 b) warnings about file backend (lack of) security
 c) a long description for metadata.xml

------- Comment #13 From David Guerizec 2006-06-29 17:15:07 0000 -------
(In reply to comment #10)
> Created an attachment (id=90453) [edit]
> sshproxy-0.4.ebuild
> 
> Improved ebuild (sorry, I can test it only on x86).
> 

I will test it on amd64.

It looks much nicer than mine, thank you ;)

As for the copying of the sshd host key, I'd rather not do it automatically.
I've set an option in the wizard for that.

And I've fixed the autogeneration of the host key not using ssh-keygen but
paramiko's internal mechanism.

------- Comment #14 From David Guerizec 2006-06-29 17:17:11 0000 -------
Created an attachment (id=90491) [edit]
sshproxy-0.4.1.ebuild

bump version to 0.4.1

------- Comment #15 From David Guerizec 2006-06-29 17:20:41 0000 -------
Created an attachment (id=90492) [edit]
metadata.xml

added metadata.xml

Hope this is not too long for a description.

Also, the file sshproxy.initd should be renamed sshproxyd.initd

------- Comment #16 From David Guerizec 2006-06-29 17:22:41 0000 -------
(In reply to comment #12)
> Another nice-to-have things would be:
>  a) some concise info messages at the end of pkg_config, explaining how to add

I've added links to corresponding parts in the documentation at the end of the
wizard.

> entries for the 2 backends available
>  b) warnings about file backend (lack of) security

You have to confirm that you really want the file backend (in the wizard)

>  c) a long description for metadata.xml

See attached file metadata.xml

Thanks for your help.

------- Comment #17 From Alin Năstac 2006-07-01 02:44:07 0000 -------
now it crashes with this log:
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/sshproxy/daemon.py", line 509, in
run_server
    _run_server(sock)
  File "/usr/lib/python2.4/site-packages/sshproxy/daemon.py", line 471, in
_run_server
    service_client(client, addr, host_key_file)
  File "/usr/lib/python2.4/site-packages/sshproxy/daemon.py", line 197, in
service_client
    conn = proxy.ProxyClient(userdata)
  File "/usr/lib/python2.4/site-packages/sshproxy/proxy.py", line 138, in
__init__
    print ("\nConnecting to %s by %s the %s" %
IOError: [Errno 5] Input/output error

If I comment out that print, it works. If I remove \n, it works. Why do you
need printing stuff when you already log the same info anyway? 

------- Comment #18 From David Guerizec 2006-07-01 10:48:06 0000 -------
(In reply to comment #17)
> now it crashes with this log:
> Traceback (most recent call last):
>   File "/usr/lib/python2.4/site-packages/sshproxy/daemon.py", line 509, in
> run_server
>     _run_server(sock)
>   File "/usr/lib/python2.4/site-packages/sshproxy/daemon.py", line 471, in
> _run_server
>     service_client(client, addr, host_key_file)
>   File "/usr/lib/python2.4/site-packages/sshproxy/daemon.py", line 197, in
> service_client
>     conn = proxy.ProxyClient(userdata)
>   File "/usr/lib/python2.4/site-packages/sshproxy/proxy.py", line 138, in
> __init__
>     print ("\nConnecting to %s by %s the %s" %
> IOError: [Errno 5] Input/output error
> 
> If I comment out that print, it works. If I remove \n, it works. Why do you
> need printing stuff when you already log the same info anyway? 
> 

I've removed the print statement completly from this module.
I've put a new tarball online with the fix:

http://penguin.fr/sshproxy/download/sshproxy-0.4.1_p1.tar.gz

------- Comment #19 From Alin Năstac 2006-07-02 01:09:18 0000 -------
ok, now it works but I still have 2 more things to be done:
 a) you made the changes suggested in comment #9 on pssh but not on pscp.
Furthermore, that comment contained an error; you should set PROXY_USER to
admin, not to ${admin}.
 b) I don't like info messages like "Server ready, clients may login now" on
service start. A service should be quiet as a mouse unless it has a fatal error
to display. Anyway, if you need that, I will put a > /dev/null on the
start-stop-daemon command line.

------- Comment #20 From David Guerizec 2006-07-02 05:15:47 0000 -------
(In reply to comment #19)
> ok, now it works but I still have 2 more things to be done:
>  a) you made the changes suggested in comment #9 on pssh but not on pscp.
> Furthermore, that comment contained an error; you should set PROXY_USER to
> admin, not to ${admin}.

Ok, this is fixed.

>  b) I don't like info messages like "Server ready, clients may login now" on
> service start. A service should be quiet as a mouse unless it has a fatal error
> to display. Anyway, if you need that, I will put a > /dev/null on the
> start-stop-daemon command line.

You're right, I don't need that on services. It's just that I'm spending so
much time coding that I don't see the obvious ;) I've made it silent in daemon
mode.

You can find an updated tarball on:

http://penguin.fr/sshproxy/download/sshproxy-0.4.1_p2.tar.gz

Thank you for your time.

------- Comment #21 From David Guerizec 2006-07-02 05:19:09 0000 -------
I wanted to precise that once you think the package is ok, I will release the
version 0.4.2, containing the fixes from 0.4.1_p* sub-versions. So the final
ebuild will be sshproxy-0.4.2.

------- Comment #22 From Alin Năstac 2006-07-02 10:01:47 0000 -------
I'm happy with this version and I wait the release of version 0.4.2 for adding
it to portage tree.

P.S. I've removed the first scenario from the metadata.xml. I think it is bad
practice from the security pov. Users should use ssh keys if they want to avoid
dealing with lots of passwords and even then they should protect their private
key with a password (ssh-agent is your friend in such cases).

The other scenarios are OK, assuming the server on which sshproxy run is
properly secured and sshproxy daemon don't allow users to retrieve passwords or
private keys.

------- Comment #23 From David Guerizec 2006-07-02 16:38:32 0000 -------
(In reply to comment #22)
> I'm happy with this version and I wait the release of version 0.4.2 for adding
> it to portage tree.

Ok, 0.4.2 was released a couple minutes ago:

http://penguin.fr/sshproxy/download/sshproxy-0.4.2.tar.gz

> P.S. I've removed the first scenario from the metadata.xml. I think it is bad
> practice from the security pov. Users should use ssh keys if they want to avoid
> dealing with lots of passwords and even then they should protect their private
> key with a password (ssh-agent is your friend in such cases).
> 
> The other scenarios are OK, assuming the server on which sshproxy run is
> properly secured and sshproxy daemon don't allow users to retrieve passwords or
> private keys.

OK for me.

------- Comment #24 From Alin Năstac 2006-07-03 11:36:14 0000 -------
fixed in cvs.
thanks!

------- Comment #25 From David Guerizec 2006-07-03 13:02:20 0000 -------
There seems to be a problem with the tarball or the digest:

kalash sshproxy # emerge -av sshproxy

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     U ] net-proxy/sshproxy-0.4.2 [0.4.1] USE="mysql" 49 kB

Total size of downloads: 49 kB

Would you like to merge these packages? [Yes/No]
>>> Emerging (1 of 1) net-proxy/sshproxy-0.4.2 to /
>>> Downloading ftp://ftp.free.fr/pub/Distributions_Linux/Gentoo/distfiles/sshproxy-0.4.2.tar.gz
--21:57:21-- 
ftp://ftp.free.fr/pub/Distributions_Linux/Gentoo/distfiles/sshproxy-0.4.2.tar.gz
           => `/usr/portage/distfiles/sshproxy-0.4.2.tar.gz'
Resolving ftp.free.fr... 212.27.60.27
Connecting to ftp.free.fr|212.27.60.27|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done.    ==> PWD ... done.
==> TYPE I ... done.  ==> CWD /pub/Distributions_Linux/Gentoo/distfiles ...
done.
==> PASV ... done.    ==> RETR sshproxy-0.4.2.tar.gz ...
No such file `sshproxy-0.4.2.tar.gz'.

>>> Downloading ftp://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/distfiles/sshproxy-0.4.2.tar.gz
--21:57:22-- 
ftp://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/distfiles/sshproxy-0.4.2.tar.gz
           => `/usr/portage/distfiles/sshproxy-0.4.2.tar.gz'
Resolving ftp.belnet.be... 193.190.198.20, 2001:6a8:3c80:0:203:baff:fe39:f931
Connecting to ftp.belnet.be|193.190.198.20|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done.    ==> PWD ... done.
==> TYPE I ... done.  ==> CWD /mirror/rsync.gentoo.org/gentoo/distfiles ...
done.
==> PASV ... done.    ==> RETR sshproxy-0.4.2.tar.gz ...
No such file `sshproxy-0.4.2.tar.gz'.

>>> Downloading http://penguin.fr/sshproxy/download/sshproxy-0.4.2.tar.gz
--21:57:22--  http://penguin.fr/sshproxy/download/sshproxy-0.4.2.tar.gz
           => `/usr/portage/distfiles/sshproxy-0.4.2.tar.gz'
Resolving penguin.fr... 88.191.11.242
Connecting to penguin.fr|88.191.11.242|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 50,596 (49K) [application/x-gzip]

100%[=================================================================================================================================================================>]
50,596       222.76K/s

21:57:23 (221.80 KB/s) - `/usr/portage/distfiles/sshproxy-0.4.2.tar.gz' saved
[50596/50596]

>>> checking ebuild checksums
!!! Digest verification failed:
!!! /usr/portage/net-proxy/sshproxy/sshproxy-0.4.2.ebuild
!!! Reason: Filesize does not match recorded size
!!! Got: 1550
!!! Expected: 1448


I didn't change the tarball since the release, and its md5 is:
fce42652f7f0cf18ee33f92512cae676
The size is: 50596 bytes

Thanks

------- Comment #26 From Jakub Moc 2006-07-03 13:48:21 0000 -------
(In reply to comment #25)
> There seems to be a problem with the tarball or the digest:

File a new bug. 

------- Comment #27 From Alin Năstac 2006-07-03 16:04:55 0000 -------
The error is about the size of the .ebuild file. Indeed, the file should have
1550 bytes.

Try to re-sync your portage tree.

------- Comment #28 From David Guerizec 2006-07-03 18:05:58 0000 -------
(In reply to comment #27)
> The error is about the size of the .ebuild file. Indeed, the file should have
> 1550 bytes.
> 
> Try to re-sync your portage tree.

Sorry, that was it.

Thanks for all.

First Last Prev Next    No search results available      Search page      Enter new bug