Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > sshd on port other than 22?

sshd on port other than 22?
Thread Tools
Zim
Senior User
Join Date: Apr 2001
Location: Cary, NC
Status: Offline
Reply With Quote
May 25, 2004, 12:52 PM
 
I'm trying to enable sshd on a port other than 22, preferably one well above 1000, and thus not as often firewalled.

I editted /etc/sshd_config and tried several combinations of Port declarations (not knowing exactly how to do multiple ports, but seeing the statement that it was permissible)

a) Port 22
Port 8022

b) Port 8022

c) port 22, 8022

and then restarted after each (how can I relaunch sshd without a restart?)

Anyway I always got connection refused for port 8022, and I was sure to add it to my ipfw rules everywhere that I already had port 22 also defined.

No router (I took it out til I had things working).

Do I need to do anything in /etc/services, or /etc/xident.d (going from memory, but may have the 2nd name wrong)?

Thanks,
Mike
     
Mac Elite
Join Date: Oct 2000
Location: Caracas, Bolivarian Republic Of Venezuela
Status: Offline
Reply With Quote
May 25, 2004, 04:10 PM
 
Originally posted by Zim:
Do I need to do anything in /etc/services, or /etc/xident.d (going from memory, but may have the 2nd name wrong)?
Yes, on Panther sshd is started by xinetd by default; add a file named something like 'myssh' in /etc/xinetd.d/ , with following content:
Code:
service myssh { disable = no port = 8022 type = UNLISTED socket_type = stream wait = no user = root server = /usr/libexec/sshd-keygen-wrapper server_args = -i groups = yes flags = REUSE IPv6 session_create = yes }
and then type: sudo killall -HUP xinetd

hth
     
Zim  (op)
Senior User
Join Date: Apr 2001
Location: Cary, NC
Status: Offline
Reply With Quote
May 25, 2004, 05:35 PM
 
Thanks!

Might have done more than was needed, but here was my solution

in /etc/services

# 7022-7029 Unassigned
myssh 7022/udp # SSH Remote Login Protocol
myssh 7022/tcp # SSH Remote Login Protocol

in /etc/xinetd.d/myssh

service myssh
{
disable = no
socket_type = stream
wait = no
user = root
port = 7022
server = /usr/libexec/sshd-keygen-wrapper
server_args = -i -p7022
groups = yes
flags = REUSE IPv6
session_create = yes
}

and in /etc/sshd_config

Port 7022
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 04:25 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2