Home Forums Software InstaDMG enable ssh and file sharing

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #375105
    Wolfraider
    Participant

    I 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.

    #375113
    jasonpgignac
    Participant

    #!/bin/bash

    # Sets remote login (SSH) on or off.

    systemsetup -setremotelogin on

    #375114
    Patrick 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

    #375118
    Wolfraider
    Participant

    The 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.

    #375128
    Patrick 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

    #375129
    Wolfraider
    Participant

    cool, thanks

    #375539
    userosx
    Participant

    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.

    #375543
    foilpan
    Participant

    in 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]

    #375549
    Patrick 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]

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.

Comments are closed