Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was trying to modify my ssh.plist file, but as a noob I overwrote my backup file with the modified one.

I am looking for the content of the original file from the install.

Can anybody give it to me?

share|improve this question
    
what ssh plist file? where is it located? – Pfitz Dec 12 '12 at 8:17
up vote 2 down vote accepted
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
    "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<true/>
<key>Label</key>
<string>com.openssh.sshd</string>
<key>Program</key>
<string>/usr/libexec/sshd-keygen-wrapper</string>
<key>ProgramArguments</key>
<array>
    <string>/usr/sbin/sshd</string>
    <string>-i</string>
</array>
<key>SHAuthorizationRight</key>
<string>system.preferences</string>
<key>Sockets</key>
<dict>
    <key>Listeners</key>
    <dict>
        <key>Bonjour</key>
        <array>
            <string>ssh</string>
            <string>sftp-ssh</string>
        </array>
        <key>SockServiceName</key>
        <string>ssh</string>
    </dict>
</dict>
<key>StandardErrorPath</key>
<string>/dev/null</string>
<key>inetdCompatibility</key>
<dict>
    <key>Wait</key>
    <false/>
</dict>
</dict>
</plist>
share|improve this answer

Can anybody give me the original ssh.plist file for OS X?

You can also find it at Apple's opensource.apple.com at launchd-ssh.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Disabled</key>
    <true/>
    <key>Label</key>
    <string>com.openssh.sshd</string>
    <key>Program</key>
    <string>/usr/libexec/sshd-keygen-wrapper</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/sbin/sshd</string>
        <string>-i</string>
    </array>
    <key>Sockets</key>
    <dict>
        <key>Listeners</key>
        <dict>
            <key>SockServiceName</key>
            <string>ssh</string>
            <key>Bonjour</key>
            <array>
                <string>ssh</string>
                <string>sftp-ssh</string>
            </array>
        </dict>
    </dict>
    <key>inetdCompatibility</key>
    <dict>
        <key>Wait</key>
        <false/>
    </dict>
    <key>StandardErrorPath</key>
    <string>/dev/null</string>
        <key>SHAuthorizationRight</key>
        <string>system.preferences</string>
</dict>
</plist>

Notice Apple uses /usr/libexec/sshd-keygen-wrapper as the program. If I recall correctly, that generates host keys if needed and then starts the actual daemon.


what ssh plist file? where is it located?

The plist file is located at /System/Library/LaunchDaemons/ssh.plist.

You can stop the server with:

sudo launchctl unload -w /System/Library/LaunchDaemons/ssh.plist

You can start the server with:

sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist


Apple also uses ancient versions of programs and libraries, so there's value in upgrading. For example, both OpenSSL and OpenSSH have both been updated due to security bugs.

You have a couple of options if you want to upgrade. First, you can build and install OpenSSH yourself by following Building OpenSSH for OS X? on Super User. Second, you can use a package tool like Brew, Fink or Macports to install it.

If you use the package manager, then you will probably want to disable Apple's OpenSSH, add a new launch daemon to start the port's gear, and use the port's configuration files.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.