All of lore.kernel.org
 help / color / mirror / Atom feed
* I thought ssh is port #22 ?!!
@ 2004-04-01  1:32 Fajar Priyanto
  2004-04-01  1:57 ` Daniel Chemko
  0 siblings, 1 reply; 13+ messages in thread
From: Fajar Priyanto @ 2004-04-01  1:32 UTC (permalink / raw)
  To: netfilter

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi guys,
I'm not really sure about this. I thought ssh is made in port #22?
When I made a ssh session into my server, /var/log/messages showed this:
Apr  1 09:20:20 server2 sshd[2711]: Accepted password for root from 
192.168.0.234 port 32873 ssh2

Why did it use port #32873?
Is there something wrong with my ssh or firewall?
TIA,
- -- 
Fajar Priyanto | Reg'd Linux User #327841 | http://linux.arinet.org
08:31:42 up 36 min, Mandrake Linux release 9.2 (FiveStar) for i586 
public key: https://www.arinet.org/fajar-pub.key
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFAa3EYkp5CsIXuxqURAluBAKCNiyg8+KXYDu/JuZghSVMXvfrjMgCdG7O2
Bb4SQcbOiAqALl1o9yQ5H1k=
=4uUZ
-----END PGP SIGNATURE-----



^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: I thought ssh is port #22 ?!!
@ 2004-04-01  2:10 cldavis
  0 siblings, 0 replies; 13+ messages in thread
From: cldavis @ 2004-04-01  2:10 UTC (permalink / raw)
  To: netfilter; +Cc: Fajar Priyanto

You should edit sshd_config with the port command and set it to 22.  If the directive is not present, I've had some versions of ssh listen on everything, others only 22.  

You may also want to use the PermitRootLogin no directive to disable root logins and use a regular user account to log in and then su to root if need be.

As far as the firewall, you may want to setup your firewall to drop all packets except packets sent to needed services.

Hope that helps
Chris
> -----Original Message-----
> From: Fajar Priyanto [mailto:fajarpri@arinet.org]
> Sent: Thursday, April 1, 2004 01:32 AM
> To: netfilter@lists.netfilter.org
> Subject: I thought ssh is port #22 ?!!
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi guys,
> I'm not really sure about this. I thought ssh is made in port #22?
> When I made a ssh session into my server, /var/log/messages showed this:
> Apr  1 09:20:20 server2 sshd[2711]: Accepted password for root from 
> 192.168.0.234 port 32873 ssh2
> 
> Why did it use port #32873?
> Is there something wrong with my ssh or firewall?
> TIA,
> - -- 
> Fajar Priyanto | Reg'd Linux User #327841 | http://linux.arinet.org
> 08:31:42 up 36 min, Mandrake Linux release 9.2 (FiveStar) for i586 
> public key: https://www.arinet.org/fajar-pub.key
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.3 (GNU/Linux)
> 
> iD8DBQFAa3EYkp5CsIXuxqURAluBAKCNiyg8+KXYDu/JuZghSVMXvfrjMgCdG7O2
> Bb4SQcbOiAqALl1o9yQ5H1k=
> =4uUZ
> -----END PGP SIGNATURE-----
> 
> 
> 




^ permalink raw reply	[flat|nested] 13+ messages in thread
* RE: I thought ssh is port #22 ?!!
@ 2004-04-01 15:14 Martinez, Michael
  2004-04-01 15:28 ` Antony Stone
  0 siblings, 1 reply; 13+ messages in thread
From: Martinez, Michael @ 2004-04-01 15:14 UTC (permalink / raw)
  To: cldavis, netfilter; +Cc: Fajar Priyanto

[-- Attachment #1: Type: text/plain, Size: 2236 bytes --]

Port 32873 is the return port on the ssh client.

Here's how it works. The server listens on port 22. The client opens a
connection to the server, and tells the server which return port to use. If
you do "netstat -an" you will see the server talking on port 22, and the
client talking on some high numbered port like 32873. The high number port
used is random. It will change from one session to the next.

This is true not just for ssh - it is true for most tcp applications.

Michael Martinez
Unix System Administrator

-----Original Message-----
From: cldavis@speakeasy.net [mailto:cldavis@speakeasy.net] 
Sent: Wednesday, March 31, 2004 9:10 PM
To: netfilter@lists.netfilter.org
Cc: Fajar Priyanto
Subject: Re: I thought ssh is port #22 ?!!

You should edit sshd_config with the port command and set it to 22.  If the
directive is not present, I've had some versions of ssh listen on
everything, others only 22.  

You may also want to use the PermitRootLogin no directive to disable root
logins and use a regular user account to log in and then su to root if need
be.

As far as the firewall, you may want to setup your firewall to drop all
packets except packets sent to needed services.

Hope that helps
Chris
> -----Original Message-----
> From: Fajar Priyanto [mailto:fajarpri@arinet.org]
> Sent: Thursday, April 1, 2004 01:32 AM
> To: netfilter@lists.netfilter.org
> Subject: I thought ssh is port #22 ?!!
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi guys,
> I'm not really sure about this. I thought ssh is made in port #22?
> When I made a ssh session into my server, /var/log/messages showed this:
> Apr  1 09:20:20 server2 sshd[2711]: Accepted password for root from 
> 192.168.0.234 port 32873 ssh2
> 
> Why did it use port #32873?
> Is there something wrong with my ssh or firewall?
> TIA,
> - -- 
> Fajar Priyanto | Reg'd Linux User #327841 | http://linux.arinet.org
> 08:31:42 up 36 min, Mandrake Linux release 9.2 (FiveStar) for i586 
> public key: https://www.arinet.org/fajar-pub.key
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.3 (GNU/Linux)
> 
> iD8DBQFAa3EYkp5CsIXuxqURAluBAKCNiyg8+KXYDu/JuZghSVMXvfrjMgCdG7O2
> Bb4SQcbOiAqALl1o9yQ5H1k=
> =4uUZ
> -----END PGP SIGNATURE-----
> 
> 
> 




[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 3732 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread
* RE: I thought ssh is port #22 ?!!
@ 2004-04-01 17:20 Daniel Chemko
  2004-04-01 18:27 ` Tony Earnshaw
  0 siblings, 1 reply; 13+ messages in thread
From: Daniel Chemko @ 2004-04-01 17:20 UTC (permalink / raw)
  To: Martinez, Michael, cldavis, netfilter; +Cc: Fajar Priyanto

Unfortunately I have the "privilage" of maintaining a customer TCP
protocol which cans you if your source and destination ports aren't as
specified by their fcked up protocol!!

-----Original Message-----
From: Martinez, Michael [mailto:MMARTINEZ@CSREES.USDA.GOV] 
Sent: Thursday, April 01, 2004 7:14 AM
To: cldavis@speakeasy.net; netfilter@lists.netfilter.org
Cc: Fajar Priyanto
Subject: RE: I thought ssh is port #22 ?!!


Port 32873 is the return port on the ssh client.

Here's how it works. The server listens on port 22. The client opens a
connection to the server, and tells the server which return port to use.
If you do "netstat -an" you will see the server talking on port 22, and
the client talking on some high numbered port like 32873. The high
number port used is random. It will change from one session to the next.

This is true not just for ssh - it is true for most tcp applications.

Michael Martinez
Unix System Administrator

-----Original Message-----
From: cldavis@speakeasy.net [mailto:cldavis@speakeasy.net] 
Sent: Wednesday, March 31, 2004 9:10 PM
To: netfilter@lists.netfilter.org
Cc: Fajar Priyanto
Subject: Re: I thought ssh is port #22 ?!!

You should edit sshd_config with the port command and set it to 22.  If
the directive is not present, I've had some versions of ssh listen on
everything, others only 22.  

You may also want to use the PermitRootLogin no directive to disable
root logins and use a regular user account to log in and then su to root
if need be.

As far as the firewall, you may want to setup your firewall to drop all
packets except packets sent to needed services.

Hope that helps
Chris
> -----Original Message-----
> From: Fajar Priyanto [mailto:fajarpri@arinet.org]
> Sent: Thursday, April 1, 2004 01:32 AM
> To: netfilter@lists.netfilter.org
> Subject: I thought ssh is port #22 ?!!
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi guys,
> I'm not really sure about this. I thought ssh is made in port #22? 
> When I made a ssh session into my server, /var/log/messages showed 
> this: Apr  1 09:20:20 server2 sshd[2711]: Accepted password for root 
> from 192.168.0.234 port 32873 ssh2
> 
> Why did it use port #32873?
> Is there something wrong with my ssh or firewall?
> TIA,
> - --
> Fajar Priyanto | Reg'd Linux User #327841 | http://linux.arinet.org
> 08:31:42 up 36 min, Mandrake Linux release 9.2 (FiveStar) for i586 
> public key: https://www.arinet.org/fajar-pub.key
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.3 (GNU/Linux)
> 
> iD8DBQFAa3EYkp5CsIXuxqURAluBAKCNiyg8+KXYDu/JuZghSVMXvfrjMgCdG7O2
> Bb4SQcbOiAqALl1o9yQ5H1k=
> =4uUZ
> -----END PGP SIGNATURE-----
> 
> 
> 





^ permalink raw reply	[flat|nested] 13+ messages in thread
* RE: I thought ssh is port #22 ?!!
@ 2004-04-01 19:41 Daniel Chemko
  2004-04-01 19:55 ` Antony Stone
  0 siblings, 1 reply; 13+ messages in thread
From: Daniel Chemko @ 2004-04-01 19:41 UTC (permalink / raw)
  To: netfilter

> It would be better if you learned not to top post and to quote
> correctly. 

If it pisses you off so much, then maybe i'll just stop posting, how's
that?


^ permalink raw reply	[flat|nested] 13+ messages in thread
* RE: I thought ssh is port #22 ?!!
@ 2004-04-01 20:22 T. Horsnell (tsh)
  2004-04-01 20:39 ` Antony Stone
  0 siblings, 1 reply; 13+ messages in thread
From: T. Horsnell (tsh) @ 2004-04-01 20:22 UTC (permalink / raw)
  To: netfilter


>> > Here's how it works. The server listens on port 22. The client opens a
>> > connection to the server, and tells the server which return port to use.
>> > If you do "netstat -an" you will see the server talking on port 22, and
>> > the client talking on some high numbered port like 32873. The high
>> > number port used is random. It will change from one session to the next.
>> >
>> > This is true not just for ssh - it is true for most tcp applications.
>
>> Unfortunately I have the "privilage" of maintaining a customer TCP
>> protocol which cans you if your source and destination ports aren't as
>> specified by their fcked up protocol!!
>
>Nevertheless, that's how TCP works, for every customer in the Universe.
>Sack your customer, and get another?.


Hmmm. I thought it went like this:

The client application requests a random high port
on the client machine (a socket). Then, using this
socket it makes a request to the required well-known
port (e.g. 22 for ssh) on the server machine.
Since no other application on the client box will ever
be given the same high-numbered port as any other
application on that box, the client-ipaddr/highPort + 
server-ipaddr/wellKnownPort combination defines a unique
'circuit' over which further communication takes place.
The client doesnt have to do special things to tell the
server what its connecting port-number is.
Until along comes ftp, which has a command channel and
a data channel. So having made a connection in the
above way for the command channel, the client and server
have to make further negotiations for a data channel.
And firewalls have to be aware of this.

Thats my two penn'orth

Cheers,
Terry.


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2004-04-01 21:38 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-01  1:32 I thought ssh is port #22 ?!! Fajar Priyanto
2004-04-01  1:57 ` Daniel Chemko
  -- strict thread matches above, loose matches on Subject: below --
2004-04-01  2:10 cldavis
2004-04-01 15:14 Martinez, Michael
2004-04-01 15:28 ` Antony Stone
2004-04-01 17:20 Daniel Chemko
2004-04-01 18:27 ` Tony Earnshaw
2004-04-01 21:27   ` Cedric Blancher
2004-04-01 21:38     ` Antony Stone
2004-04-01 19:41 Daniel Chemko
2004-04-01 19:55 ` Antony Stone
2004-04-01 20:22 T. Horsnell (tsh)
2004-04-01 20:39 ` Antony Stone

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.