diff -ur orig/openssh-6.0p1/configure.ac openssh-6.0p1/configure.ac
--- orig/openssh-6.0p1/configure.ac	2012-04-19 13:46:38.045613056 +0200
+++ openssh-6.0p1/configure.ac	2013-04-29 21:27:34.023068672 +0200
@@ -92,7 +92,9 @@
 	fi
 fi
 
-AC_PATH_PROG([PATH_PASSWD_PROG], [passwd])
+if test -z "$PATH_PASSWD_PROG" ; then
+	AC_PATH_PROG([PATH_PASSWD_PROG], [passwd])
+fi
 if test ! -z "$PATH_PASSWD_PROG" ; then
 	AC_DEFINE_UNQUOTED([_PATH_PASSWD_PROG], ["$PATH_PASSWD_PROG"],
 		[Full path of your "passwd" program])
@@ -1432,7 +1434,7 @@
 			LIBEDIT=`$PKGCONFIG --libs-only-l libedit`
 			CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags libedit`"
 		else
-			LIBEDIT="-ledit -lcurses"
+			AC_CHECK_LIB(curses, tgetent, [LIBEDIT="-ledit -lcurses"], AC_CHECK_LIB(ncurses, tgetent, [LIBEDIT="-ledit -lncurses"]))
 		fi
 		OTHERLIBS=`echo $LIBEDIT | sed 's/-ledit//'`
 		AC_CHECK_LIB([edit], [el_init],
diff -ur orig/openssh-6.0p1/pathnames.h openssh-6.0p1/pathnames.h
--- orig/openssh-6.0p1/pathnames.h	2011-05-29 13:39:38.054788096 +0200
+++ openssh-6.0p1/pathnames.h	2013-04-29 21:29:17.578289664 +0200
@@ -58,25 +58,25 @@
  * The directory in user's home directory in which the files reside. The
  * directory should be world-readable (though not all files are).
  */
-#define _PATH_SSH_USER_DIR		".ssh"
+#define _PATH_SSH_USER_DIR		"config/settings/ssh"
 
 /*
  * Per-user file containing host keys of known hosts.  This file need not be
  * readable by anyone except the user him/herself, though this does not
  * contain anything particularly secret.
  */
-#define _PATH_SSH_USER_HOSTFILE		"~/.ssh/known_hosts"
+#define _PATH_SSH_USER_HOSTFILE		"~/" _PATH_SSH_USER_DIR "/known_hosts"
 /* backward compat for protocol 2 */
-#define _PATH_SSH_USER_HOSTFILE2	"~/.ssh/known_hosts2"
+#define _PATH_SSH_USER_HOSTFILE2	"~/" _PATH_SSH_USER_DIR "/known_hosts2"
 
 /*
  * Name of the default file containing client-side authentication key. This
  * file should only be readable by the user him/herself.
  */
-#define _PATH_SSH_CLIENT_IDENTITY	".ssh/identity"
-#define _PATH_SSH_CLIENT_ID_DSA		".ssh/id_dsa"
-#define _PATH_SSH_CLIENT_ID_ECDSA	".ssh/id_ecdsa"
-#define _PATH_SSH_CLIENT_ID_RSA		".ssh/id_rsa"
+#define _PATH_SSH_CLIENT_IDENTITY	_PATH_SSH_USER_DIR "/identity"
+#define _PATH_SSH_CLIENT_ID_DSA		_PATH_SSH_USER_DIR "/id_dsa"
+#define _PATH_SSH_CLIENT_ID_ECDSA	_PATH_SSH_USER_DIR "/id_ecdsa"
+#define _PATH_SSH_CLIENT_ID_RSA		_PATH_SSH_USER_DIR "/id_rsa"
 
 /*
  * Configuration file in user's home directory.  This file need not be
@@ -84,7 +84,7 @@
  * particularly secret.  If the user's home directory resides on an NFS
  * volume where root is mapped to nobody, this may need to be world-readable.
  */
-#define _PATH_SSH_USER_CONFFILE		".ssh/config"
+#define _PATH_SSH_USER_CONFFILE		_PATH_SSH_USER_DIR "/config"
 
 /*
  * File containing a list of those rsa keys that permit logging in as this
@@ -94,10 +94,10 @@
  * may need to be world-readable.  (This file is read by the daemon which is
  * running as root.)
  */
-#define _PATH_SSH_USER_PERMITTED_KEYS	".ssh/authorized_keys"
+#define _PATH_SSH_USER_PERMITTED_KEYS	_PATH_SSH_USER_DIR "/authorized_keys"
 
 /* backward compat for protocol v2 */
-#define _PATH_SSH_USER_PERMITTED_KEYS2	".ssh/authorized_keys2"
+#define _PATH_SSH_USER_PERMITTED_KEYS2	_PATH_SSH_USER_DIR "/authorized_keys2"
 
 /*
  * Per-user and system-wide ssh "rc" files.  These files are executed with
@@ -105,7 +105,7 @@
  * passed "proto cookie" as arguments if X11 forwarding with spoofing is in
  * use.  xauth will be run if neither of these exists.
  */
-#define _PATH_SSH_USER_RC		".ssh/rc"
+#define _PATH_SSH_USER_RC		_PATH_SSH_USER_DIR "/rc"
 #define _PATH_SSH_SYSTEM_RC		SSHDIR "/sshrc"
 
 /*
diff -ur orig/openssh-6.0p1/sshd_config openssh-6.0p1/sshd_config
--- orig/openssh-6.0p1/sshd_config	2011-05-29 13:39:39.064225280 +0200
+++ openssh-6.0p1/sshd_config	2013-04-29 12:51:20.314834944 +0200
@@ -47,7 +47,7 @@
 
 # The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
 # but this is overridden so installations will only check .ssh/authorized_keys
-AuthorizedKeysFile	.ssh/authorized_keys
+AuthorizedKeysFile	config/settings/ssh/authorized_keys
 
 # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
 #RhostsRSAAuthentication no
