Koozali.org: home of the SME Server

How to change SSHD's port? ([FOUND] SME as a HTTP relay?)

big_gie

How to change SSHD's port? ([FOUND] SME as a HTTP relay?)
« on: August 16, 2004, 05:02:44 AM »
Hi,

I would like to install a HTTP relay on SME. Is it possible??

I'm looking for something using sometimes some "free anonymous web proxies" but they don't support ssl and are full of ads... Is it possible to install one on SME???

Thank you very much!

big_gie

How to change SSHD's port? ([FOUND] SME as a HTTP relay?)
« Reply #1 on: August 20, 2004, 05:12:21 AM »
The easiest solution I've found was to ssh to the server with fowarding 3128:localhost:3128. Setting the proxy server in my browser on localhost:3128 made it.

I'm getting really into SME... its really nice!!! :)

Does anyone knows how to change sshd's port? There is a contrib (e-smith-sshd10022-0.1.0-1.noarch.rpm) but it didn't installed correctly and I would like to choose the port, not set it to 10022...

Thank you very much :)

Michiel

How to change SSHD's port? ([FOUND] SME as a HTTP relay?)
« Reply #2 on: August 20, 2004, 03:11:57 PM »
Quote
Does anyone knows how to change sshd's port? There is a contrib (e-smith-sshd10022-0.1.0-1.noarch.rpm) but it didn't installed correctly and I would like to choose the port, not set it to 10022...


Why didn't this contrib install correctly? How did you install it?

If you look into the rpm, you'll see the two files that are needed to change the port number and open it on the firewall. Just fire-up "mc", select the rpm, make sure it is not "executable" and hit enter. You can thus navigate the content of the rpm.

Michiel[/quote]

big_gie

How to change SSHD's port? ([FOUND] SME as a HTTP relay?)
« Reply #3 on: August 20, 2004, 03:33:07 PM »
Thanx :)

I've found this editing the RPM:
Quote
# Configure sshd
/sbin/e-smith/expand-template /etc/ssh/sshd_config
/etc/init.d/sshd restart

# Open port on firewall
/sbin/e-smith/expand-template /etc/rc.d/init.d/masq
/etc/init.d/masq restart
# Restore sshd
/sbin/e-smith/expand-template /etc/ssh/sshd_config
/etc/init.d/sshd restart

# Close port on firewall
/sbin/e-smith/expand-template /etc/rc.d/init.d/masq
/etc/init.d/masq restart

So what it tells me is to edit a template, inst it?

I tryed installing the package yesterday but I got errors. I can't remember which ones, it was late... I tryed installing/reinstalling/unistalling today and here is what I had:
Quote
[root@<...> rpms]# rpm -ivh e-smith-sshd10022-0.1.0-1.noarch.rpm
Preparing...                ########################################### [100%]
package e-smith-sshd10022-0.1.0-1 is already installed
[root@<...> rpms]# rpm -e e-smith-sshd10022-0.1.0-1.noarch.rpm
error: package e-smith-sshd10022-0.1.0-1.noarch.rpm is not installed
[root@<...> rpms]#


I'd prefer to choose the port rater then having it set to 10022. I'm trying to understand how to make a template but for now I don't really know... :roll:

Thanx for the help  ;-)

Michiel

How to change SSHD's port? ([FOUND] SME as a HTTP relay?)
« Reply #4 on: August 20, 2004, 03:55:12 PM »
OK, some rpm-basics are needed here ;-)

Quote
[root@<...> rpms]# rpm -ivh e-smith-sshd10022-0.1.0-1.noarch.rpm
Preparing... ########################################### [100%]
package e-smith-sshd10022-0.1.0-1 is already installed


So this tells you it was installed correctly. The preferred way to install an rpm is "rpm -Uvh ..." as this will take care of both installs and upgrades.

Quote
[root@<...> rpms]# rpm -e e-smith-sshd10022-0.1.0-1.noarch.rpm
error: package e-smith-sshd10022-0.1.0-1.noarch.rpm is not installed

To remove a package, you must give the name of the package without the .noarch.rpm. So to remove the package just run "rpm -e e-smith-sshd10022-0.1.0-1"

Quote
Quote:
# Configure sshd
/sbin/e-smith/expand-template /etc/ssh/sshd_config
/etc/init.d/sshd restart

# Open port on firewall
/sbin/e-smith/expand-template /etc/rc.d/init.d/masq
/etc/init.d/masq restart
# Restore sshd
/sbin/e-smith/expand-template /etc/ssh/sshd_config
/etc/init.d/sshd restart

# Close port on firewall
/sbin/e-smith/expand-template /etc/rc.d/init.d/masq
/etc/init.d/masq restart
 
So what it tells me is to edit a template, inst it?


No, these commands only insert the templates in the config files and restart the relevant services.

Since the package is still installed on your server, you should now be able to log in on your server using a ssh client on port 10022. Make sure you tell your client to use that port and not the standard port 22.

The actual template sniplets can be found in
/etc/e-smith/templates-custom/etc/rc.d/init.d/masq/45Open10022
and
/etc/e-smith/templates-custom/etc/ssh/sshd_config/11Port10022

Change the port number to your liking, issue the above commands and you should be OK.

But why bother, 10022 works just fine and using an "unknown" portnumber doesn't add anything to your security.

Michiel

big_gie

How to change SSHD's port? ([FOUND] SME as a HTTP relay?)
« Reply #5 on: August 20, 2004, 04:10:43 PM »
Thanx m8  ;-)

I should have tough of the .norarch.rpm thing.. I'm forgoting my linux knowledge ;-)

When uninstalling I get:
Quote
[root@<...> rpms]# rpm -e e-smith-sshd10022-0.1.0-1
Arrêt de sshd :[   OK   ]
Démarrage de sshd :[   OK   ]
WARNING in /etc/e-smith/templates//etc/rc.d/init.d/masq/00Definitions: Use of un
initialized value in concatenation (.) or string at /etc/e-smith/templates//etc/
rc.d/init.d/masq/00Definitions line 5.
WARNING: Template processing succeeded for //etc/rc.d/init.d/masq: 1 fragment ge
nerated warnings
 at /sbin/e-smith/expand-template line 49

Shutting down IP masquerade and firewall rules:         Done!

Enabling IP masquerading: Warning: wierd character in interface -j' (No aliases
, :, ! or *).
Bad argument ACCEPT'
Try iptables -h' or 'iptables --help' for more information.
Warning: wierd character in interface -j' (No aliases, :, ! or *).
Bad argument PostroutingOutbound'
Try iptables -h' or 'iptables --help' for more information.
Warning: wierd character in interface --jump' (No aliases, :, ! or *).
Bad argument InboundUDP'
Try iptables -h' or 'iptables --help' for more information.
Warning: wierd character in interface --jump' (No aliases, :, ! or *).
Bad argument denylog'
Try iptables -h' or 'iptables --help' for more information.
Warning: wierd character in interface --jump' (No aliases, :, ! or *).
Bad argument ACCEPT'
Try iptables -h' or 'iptables --help' for more information.
Warning: wierd character in interface --jump' (No aliases, :, ! or *).
Bad argument denylog'
Try iptables -h' or 'iptables --help' for more information.
Warning: wierd character in interface --jump' (No aliases, :, ! or *).
Bad argument ACCEPT'
Try iptables -h' or 'iptables --help' for more information.
Warning: wierd character in interface --jump' (No aliases, :, ! or *).
Bad argument ACCEPT'
Try iptables -h' or 'iptables --help' for more information.
Warning: wierd character in interface --jump' (No aliases, :, ! or *).
Bad argument denylog'
Try iptables -h' or 'iptables --help' for more information.
Warning: wierd character in interface --jump' (No aliases, :, ! or *).
Bad argument denylog'
Try iptables -h' or 'iptables --help' for more information.
Warning: wierd character in interface --jump' (No aliases, :, ! or *).
Bad argument denylog'
Try iptables -h' or 'iptables --help' for more information.
Warning: wierd character in interface --jump' (No aliases, :, ! or *).
Bad argument denylog'
Try iptables -h' or 'iptables --help' for more information.
Warning: wierd character in interface --jump' (No aliases, :, ! or *).
Bad argument ACCEPT'
Try iptables -h' or 'iptables --help' for more information.
Warning: wierd character in interface --jump' (No aliases, :, ! or *).
Bad argument ACCEPT'
Try iptables -h' or 'iptables --help' for more information.
Warning: wierd character in interface --jump' (No aliases, :, ! or *).
Bad argument denylog'
Try iptables -h' or 'iptables --help' for more information.
done
[root@<...> rpms]#

Which looks like the errors I got when installing...

I then reinstalled it:
Quote
[root@<...> rpms]# rpm -Uvh e-smith-sshd10022-0.1.0-1.noarch.rpm
Preparing...                ########################################### [100%]
   1:e-smith-sshd10022      ########################################### [100%]
Arrêt de sshd :[   OK   ]
Démarrage de sshd :[   OK   ]
WARNING in /etc/e-smith/templates//etc/rc.d/init.d/masq/00Definitions: Use of uninitialized value in concatenation (.) or string at /etc/e-smith/templates//etc/rc.d/init.d/masq/00Definitions line 5.
WARNING: Template processing succeeded for //etc/rc.d/init.d/masq: 1 fragment generated warnings
 at /sbin/e-smith/expand-template line 49

Shutting down IP masquerade and firewall rules:         Done!

Enabling IP masquerading: Warning: wierd character in interface -j' (No aliases, :, ! or *).
Bad argument ACCEPT'
Try iptables -h' or 'iptables --help' for more information.
Warning: wierd character in interface -j' (No aliases, :, ! or *).
Bad argument PostroutingOutbound'
Try iptables -h' or 'iptables --help' for more information.
Warning: wierd character in interface --jump' (No aliases, :, ! or *).
Bad argument InboundUDP'
Try iptables -h' or 'iptables --help' for more information.
Warning: wierd character in interface --jump' (No aliases, :, ! or *).
Bad argument denylog'
Try iptables -h' or 'iptables --help' for more information.
Warning: wierd character in interface --jump' (No aliases, :, ! or *).
Bad argument ACCEPT'
Try iptables -h' or 'iptables --help' for more information.
Warning: wierd character in interface --jump' (No aliases, :, ! or *).
Bad argument denylog'
Try iptables -h' or 'iptables --help' for more information.
Warning: wierd character in interface --jump' (No aliases, :, ! or *).
Bad argument ACCEPT'
Try iptables -h' or 'iptables --help' for more information.
Warning: wierd character in interface --jump' (No aliases, :, ! or *).
Bad argument ACCEPT'
Try iptables -h' or 'iptables --help' for more information.
Warning: wierd character in interface --jump' (No aliases, :, ! or *).
Bad argument denylog'
Try iptables -h' or 'iptables --help' for more information.
Warning: wierd character in interface --jump' (No aliases, :, ! or *).
Bad argument denylog'
Try iptables -h' or 'iptables --help' for more information.
Warning: wierd character in interface --jump' (No aliases, :, ! or *).
Bad argument denylog'
Try iptables -h' or 'iptables --help' for more information.
Warning: wierd character in interface --jump' (No aliases, :, ! or *).
Bad argument denylog'
Try iptables -h' or 'iptables --help' for more information.
Warning: wierd character in interface --jump' (No aliases, :, ! or *).
Bad argument ACCEPT'
Try iptables -h' or 'iptables --help' for more information.
Warning: wierd character in interface --jump' (No aliases, :, ! or *).
Bad argument ACCEPT'
Try iptables -h' or 'iptables --help' for more information.
Warning: wierd character in interface --jump' (No aliases, :, ! or *).
Bad argument denylog'
Try iptables -h' or 'iptables --help' for more information.
Warning: wierd character in interface --jump' (No aliases, :, ! or *).
Bad argument ACCEPT'
Try iptables -h' or 'iptables --help' for more information.
done
[root@<...> rpms]#


But, contrarly to last time, connecting to port 10022 now works :)

For the moment I'll let it like this and I thank you for your time :) Maybe I'll get more into templates a bit later.

Thanx again!!  :pint:

cc_skavenger

SSHD port
« Reply #6 on: August 20, 2004, 11:00:36 PM »
Here's a step by step howto:

http://no.longer.valid/phpwiki/index.php/Changing%20the%20default%20ssh%20port


I never knew that there was a contrib for this.


HTH

big_gie

How to change SSHD's port? ([FOUND] SME as a HTTP relay?)
« Reply #7 on: August 20, 2004, 11:08:49 PM »
Thanks cc_skavenger!!! Thats what I was looking for :)

chears!