To rename a file you'll use the mv (move) command. It's pretty straight-forward:
mv com.apple.access_ssh com.apple.access_ssh-disabled
Thanks Mooose ... but it's a group not a file :)
Now I understand why you were asking about dscl and dseditgroup.
I did find a page that offers this command:
dscl . change /Groups/com.apple.access_ssh RecordName com.apple.access_ssh com.apple.access_ssh-disabled
Sounds like what you're needing but I haven't tested.
Thanks! I think I read the same page you found but missed that snippet.
It works fine. I did notice that the settings in Sharing stayed the same even though the group was renamed so I forced the sshd to reread it's config using:
ps -ef | grep sshd | awk {'print $2'} | sudo xargs kill -HUP
That seems to kill any active connections so I will need to test to see if that's a problem - probably not. Otherwise a restart will do the same thing.
Hmmm - and now when I try that command to HUP sshd it doesn't seem to reread the file
more investigation required ...
Restarting works though.
Stumbled upon this old post. Since I'm resurrecting this post, it'll take −1 to all attack rolls, skill checks, saving throws, and ability checks. I'm sorry. Anyway...
I think @dlondon was looking to run something like this:
launchctl unload /System/Library/LaunchDaemons/ssh.plist
launchctl load -w /System/Library/LaunchDaemons/ssh.plist
This should reload SSH with the new settings without requiring a reboot. At least its been working for me on 10.9 and newer when I was trying to lock SSH down to 2 specific accounts.
Thanks Steven,
Sometimes my Linux/Unix/Mac stills are found wanting. Apppreciate your correction
Regards,
David