On 2006-03-09, Barry Margolin <barmar@alum.mit.edu> wrote:
will connect to 2022 on the Mac. How do I change the port that Tiger's SSH server listens on? I tried editing the "Port" line in /etc/sshd_config, but it didn't have any effect.
Edit /System/Library/LaunchDaemons/ssh.plist. Put 2022 or whatever you prefer as the value of the SockServiceName key.
Or change /etc/services so that 'ssh' maps to 2022.
Edit /System/Library/LaunchDaemons/ssh.plist. Put 2022 or whatever you
prefer as the value of the SockServiceName key.
I did this. It works when I then enable Remote Login in the Sharing preferences, but when the machine reboots it starts listening on port 22 again.
If it makes a difference, I made a copy of ssh.plist named
ssh.orig.plist, and then edited ssh.plist.
I rescind those recommendations. Either will work, but it's not a good
idea to modify these files since you never know when a system update
will replace them. Instead, make an entirely new launch daemon and put
it in /Library/LaunchDaemons, which Apple updaters will never touch.
You can disable the standard ssh daemon if you like, or leave it running
for lan use.
Instead, make an entirely new launch daemon and put
it in /Library/LaunchDaemons
I've done this, but it's not working. When I try to connect, the
connection is immediately closed, and Console shows the following log messages:
Apr 21 20:24:03 Barry-Margolins-Computer sshd[9319]: error: Could not
load host key: /etc/ssh_host_key
The files that it says it can't load are only readable by root. Could daemons launched from /Library/LaunchDaemons instead of /System/Library/LaunchDaemons be running as an ordinary user, rather
than root?
Does it run them as the user who ran launchctl?
On 2006-04-22, Barry Margolin <barmar@alum.mit.edu> wrote:
Instead, make an entirely new launch daemon and put
it in /Library/LaunchDaemons
I've done this, but it's not working. When I try to connect, the connection is immediately closed, and Console shows the following log messages:
Apr 21 20:24:03 Barry-Margolins-Computer sshd[9319]: error: Could not
load host key: /etc/ssh_host_key
[etc]
Very strange. Just to confirm, your new file should look like this:
Also, the file should be owned by root:wheel, and should be 644.
The files that it says it can't load are only readable by root. Could daemons launched from /Library/LaunchDaemons instead of /System/Library/LaunchDaemons be running as an ordinary user, rather
than root?
Mine runs as root, but I agree that it sounds as if yours doesn't.
Does it run them as the user who ran launchctl?
It might. I never tried this except via sudo. But root will do the
work at boot time, at least it does on my machines. Are you always
enabling manually, and always as an ordinary user?
Sysop: | Gate Keeper |
---|---|
Location: | Shelby, NC |
Users: | 790 |
Nodes: | 20 (0 / 20) |
Uptime: | 41:54:49 |
Calls: | 12,115 |
Files: | 5,294 |
Messages: | 564,934 |