- This topic has 8 replies, 6 voices, and was last updated 16 years, 1 month ago by
Patrick Gallagher.
-
AuthorPosts
-
January 8, 2009 at 11:54 pm #375105
Wolfraider
ParticipantI am looking for the commands to enable Remote Logon (ssh) and File Sharing from the Sharing tab of System Preferences. Also, is there a good way to check the box for Require password for each Preference without MCX? We so use a directory structure but would like to have this option enabled by default, just in case something happened to the directory. This will be used in a script after the Mac is booted.
January 10, 2009 at 2:15 am #375113jasonpgignac
Participant#!/bin/bash
# Sets remote login (SSH) on or off.
systemsetup -setremotelogin on
January 10, 2009 at 5:33 am #375114Patrick Fergus
Participant[QUOTE][u]Quote by: Wolfraider[/u][p]Also, is there a good way to check the box for Require password for each Preference without MCX?[/p][/QUOTE]
That’s the system.preferences key in /etc/authorization. You’re going to need Plistbuddy (/usr/libexec/PlistBuddy) to tweak it. Look for discussions of how to enable setting the initial DVD region for examples that are close to what you’re doing.
[QUOTE][u]Quote by: Wolfraider[/u][p]I am looking for the commands to enable Remote Logon (ssh) and File Sharing from the Sharing tab of System Preferences.[/p][/QUOTE]
Off the top of my head none in OS X client–try using fseventer (I used it above to determine which file is modified when the “Require password” option is checked) to see what gets modified when you turn on AFP.
– Patrick
January 12, 2009 at 11:20 pm #375118Wolfraider
ParticipantThe SSH script worked great, thanks
On the File Sharing, I simply checked the box on a built mac. I then copied the /System/Library/LaunchDaemons/com.apple.AFPServer.plist and created a package to copy this to my image. File Sharing is now started on all images.
I am giving up on the require password, its not that big of deal.
Thanks everyone.
January 13, 2009 at 8:45 pm #375128Patrick Fergus
Participant[u]Quote by: Wolfraider[/u][quote]Also, is there a good way to check the box for Require password for each Preference without MCX?[/quote]
Stolen from [url]http://www.peelman.us/wiki/index.php?title=Perl_Setup_Script[/url]:[code]/usr/local/sbin/PlistBuddy -c “set :rights:system.preferences:shared false” /etc/authorization[/code]Need to adjust the target to $3/etc/authorization, but it should work.
– Patrick
January 13, 2009 at 9:15 pm #375129Wolfraider
Participantcool, thanks
February 24, 2009 at 4:32 pm #375539userosx
ParticipantI’ve been using the referenced command (systemsetup -setremotelogin on) for some time now, but I need to specify “Allow access for:”, “Only these users:”, Administrators. Is it possible to specify which user/group has ssh access via the command line? I found the plist file (/var/db/dslocal/nodes/Default/groups/com.apple.access_ssh.plist), but it appears dynamic and not something I could rewrite using defaults or plistbuddy. I’m guessing there’s a simpler way.
February 24, 2009 at 8:12 pm #375543foilpan
Participantin that file, it looks like what you’d need to change is the groupmembers key.
in mine, it looks like this after adding a user:
[code]
groupmembers
63578BFC-6F01-11D8-A84F-000A95AD0E0A
[/code]
that’s just the generated uid of the given user or group. you’d have to plug in the guid of the user/group you want, possibly with something like
[code]
dscl . -read /users/username GeneratedUID | awk ‘{print $2}’
[/code]February 25, 2009 at 12:13 am #375549Patrick Gallagher
Participant[QUOTE][u]Quote by: userosx[/u][p]I’ve been using the referenced command (systemsetup -setremotelogin on) for some time now, but I need to specify “Allow access for:”, “Only these users:”, Administrators. Is it possible to specify which user/group has ssh access via the command line? I found the plist file (/var/db/dslocal/nodes/Default/groups/com.apple.access_ssh.plist), but it appears dynamic and not something I could rewrite using defaults or plistbuddy. I’m guessing there’s a simpler way. [/p][/QUOTE]
Try this:
[code]dseditgroup -o create -q com.apple.access_ssh
dseditgroup -o edit -a eccsadmin -t user com.apple.access_ssh[/code] -
AuthorPosts
- You must be logged in to reply to this topic.
Comments are closed