def guess_user_home(other_user=nil)
      this_user = other_user || opts[:user]
      @rye_guessed_homes ||= {}
      
      # A simple cache. 
      return @rye_guessed_homes[this_user] if @rye_guessed_homes.has_key?(this_user)
      
      # Some junk to determine where user home directories are by default.
      # We're relying on the command "useradd -D" so this may not work on
      # different Linuxen and definitely won't work on Windows.
      # This code will be abstracted out once I find a decent home for it.
      # /etc/default/useradd, HOME=/home OR useradd -D
      # /etc/adduser.config, DHOME=/home OR ??
      user_defaults = {}
      ostmp = self.ostype
      ostmp &&= ostype.to_s
      
      if ostmp == "sunos"
        #nv.scan(/([\w_-]+?)=(.+?)\s/).each do |n, v|
        #  n = 'HOME' if n == 'basedir'
        #  user_defaults[n.upcase] = v.strip
        #end
        # In Solaris, useradd -D says the default home path is /home
        # but that directory is not writable. See: http://bit.ly/IJDD0
        user_defaults['HOME'] = '/export/home'
      elsif ostmp == "darwin"
        user_defaults['HOME'] = '/Users'
      elsif ostmp == "windows"
        user_defaults['HOME'] = 'C:/Documents and Settings'
      else
        raw = self.quietly { useradd(:D) } rescue []
        raw = ["HOME=/home"] if raw.nil? || raw.empty?
        raw.each do |nv|
          n, v = nv.scan(/\A([\w_-]+?)=(.+)\z/).flatten
          user_defaults[n] = v
        end
      end
      
      @rye_guessed_homes[this_user] = "#{user_defaults['HOME']}/#{this_user}"
    end
def guess_user_home(other_user=nil)
      this_user = other_user || opts[:user]
      @rye_guessed_homes ||= {}
      
      # A simple cache. 
      return @rye_guessed_homes[this_user] if @rye_guessed_homes.has_key?(this_user)
      
      # Some junk to determine where user home directories are by default.
      # We're relying on the command "useradd -D" so this may not work on
      # different Linuxen and definitely won't work on Windows.
      # This code will be abstracted out once I find a decent home for it.
      # /etc/default/useradd, HOME=/home OR useradd -D
      # /etc/adduser.config, DHOME=/home OR ??
      user_defaults = {}
      ostmp = self.ostype
      ostmp &&= ostype.to_s
      
      if ostmp == "sunos"
        #nv.scan(/([\w_-]+?)=(.+?)\s/).each do |n, v|
        #  n = 'HOME' if n == 'basedir'
        #  user_defaults[n.upcase] = v.strip
        #end
        # In Solaris, useradd -D says the default home path is /home
        # but that directory is not writable. See: http://bit.ly/IJDD0
        user_defaults['HOME'] = '/export/home'
      elsif ostmp == "darwin"
        user_defaults['HOME'] = '/Users'
      elsif ostmp == "windows"
        user_defaults['HOME'] = 'C:/Documents and Settings'
      else
        raw = self.quietly { useradd(:D) } rescue []
        raw = ["HOME=/home"] if raw.nil? || raw.empty?
        raw.each do |nv|
          n, v = nv.scan(/\A([\w_-]+?)=(.+)\z/).flatten
          user_defaults[n] = v
        end
      end
      
      @rye_guessed_homes[this_user] = "#{user_defaults['HOME']}/#{this_user}"
    end
Uses the output of "useradd -D" to determine the default home
 directory. This returns a GUESS rather than the a user's real
 home directory. Currently used only by authorize_keys_remote.
 Only useful before you've logged in. Otherwise check $HOME