[olug] SSHD on a different port

David Walker linux_user at grax.com
Fri Jan 18 12:16:01 UTC 2002


Note that you can change /etc/ssh/ssh_config so you don't have to enter the 
port every time.  Put the following section before the "Host *" section in 
the config file.  Or if you want to make your altnernate port the default for 
your network put the Port directive in your "Host *" section.

Host 192.168.2.50 192.168.2.51 192.168.3.*
        Port 45678



On Friday 18 January 2002 01:29 am, you wrote:
> I was just having some difficulties lately with changing the port of my
> openssh server, so I thought I'd share just in case anyone else ever runs
> into the same problem.
>
> So, I just wanted to change the port sshd runs on, should be simple
> enough... edit /etc/ssh/sshd_config and set 'Port xxx' where xxx is a
> valid port number (default is 22).  So I did that, stoped (#
> /etc/init.d/ssh stop) and started (# /etc/init.d/ssh start) the sshd
> deamon, and tried to connect as:
>
> $ ssh bwiese at localhost:xxx      and      $ ssh bwiese at localhost xxx
>
> That didn't work, but its not the server's fault, which I had thought, it
> was stupid me's fault, in the client. I thought the port was added after a
> colon or a space, reading man ssh though, we find you use the -p option.
> So the command as
>
> $ ssh bwiese at localhost -p xxx
>
> did work. :) Great. now trying scp?  Simple too, after checking the man
> page on scp.  To copy a file from a local directory to a remote one is
> something like this.
>
> $ scp -P xxx filetotrasnfer.txt bwiese@<ip address>:~/path/to/copy/to/
>
> so, in case anyone else decides to try changing the default ssh port,
> there ya go. notice in scp though that it is a capital P and the port
> option comes first in the command... weird. :)
> peace
>
> -----------
> Brian Wiese
> -----------
> bwiese at cotse.net
> "FREEDOM!"  - Braveheart
>
> -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
>
> For help contact olug-help at bstc.net - run by ezmlm
> to unsubscribe, send mail to olug-unsubscribe at bstc.net
> or `mail olug-unsubscribe at bstc.net < /dev/null`
> (c)2001 OLUG http://www.olug.org
>
> -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

For help contact olug-help at bstc.net - run by ezmlm
to unsubscribe, send mail to olug-unsubscribe at bstc.net
or `mail olug-unsubscribe at bstc.net < /dev/null`
(c)2001 OLUG http://www.olug.org

-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_




More information about the OLUG mailing list