[olug] SSHD on a different port
Brian Wiese
bwiese at cotse.com
Fri Jan 18 07:29:16 UTC 2002
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
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
More information about the OLUG
mailing list