Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Linux machine on my network. I connect to it using SSH with PuTTY over the Internet, so I have forwarded port 22 to the machine.

Now I need to put another Linux machine on the network. I will want to connect to this new machine using PuTTY as well. I want to run telnet/SSH on it using a port other than 22 so that I can forward it.

How can I make this happen?

share|improve this question

closed as off topic by studiohack Mar 21 '11 at 18:48

Questions on Super User are expected to relate to computer software or computer hardware within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

It's not completely clear what you are asking. Are you configuring your ssh server or your telnet server? – Olli Mar 21 '11 at 18:14
Possible dupe of:… – peelman Mar 21 '11 at 18:47
@studio Off topic? – Daniel Beck Mar 21 '11 at 20:54
@DanielBeck: this was flagged as belonging on SF, and there is already a question like it (see peelman's comment above), so instead of migrating and having it closed there, I just closed it here... – studiohack Mar 21 '11 at 21:00
@studiohack I was confused about going to SuperUser or ServerFault. – TheVillageIdiot Mar 22 '11 at 3:45
up vote 3 down vote accepted

It depends on your ssh server (and Linux distro).

Check out /etc/ssh/sshd_config (or similar, this is at least in Debian based distributions).

There is line

Port 22

Change it and restart your sshd (usually /etc/init.d/ssh restart, it may be also /etc/init.d/sshd).

share|improve this answer
looks promising! – TheVillageIdiot Mar 21 '11 at 18:20
it worked like a charm! – TheVillageIdiot Mar 21 '11 at 18:40

You are running from outside of the network? (internet connection?) If not you don't need to forward port and just connect with ssh ip or ssh hostname (or equivalent using putty configurations). If you are out of the network and need port forwarding, you only need to edit /etc/ssh/sshd_config server file and change the #Port 22 line to the port you want and remove comment. After you need to restart ssh on the server.

share|improve this answer
sure I am connecting over internet. – TheVillageIdiot Mar 21 '11 at 18:41

Not the answer you're looking for? Browse other questions tagged or ask your own question.