You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Compiling OpenSSH

Hi all,

Apologies if this isn't quite the right forum for this, but I'm attempting to recompile OpenSSH (downloaded the latest source from opensource.apple.com) for the purpose of modifying the minimum key length option. When I attempt to run make I get the following error:

Undefined symbols:
" res_9query", referenced from:
_getrrsetbyname in libopenbsd-compat.a(getrrsetbyname.o)
" res_9getshort", referenced from:
parse_dnsrrsection in libopenbsd-compat.a(getrrsetbyname.o)
parse_dnsrrsection in libopenbsd-compat.a(getrrsetbyname.o)
parse_dnsrrsection in libopenbsd-compat.a(getrrsetbyname.o)
_getrrsetbyname in libopenbsd-compat.a(getrrsetbyname.o)
_getrrsetbyname in libopenbsd-compat.a(getrrsetbyname.o)
" res_9getlong", referenced from:
parse_dnsrrsection in libopenbsd-compat.a(getrrsetbyname.o)
" res_9init", referenced from:
_getrrsetbyname in libopenbsd-compat.a(getrrsetbyname.o)
" res_9_dnexpand", referenced from:
parse_dnsrrsection in libopenbsd-compat.a(getrrsetbyname.o)
_getrrsetbyname in libopenbsd-compat.a(getrrsetbyname.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: * [ssh] Error 1

If anyone has any tips/ideas on what could be causing this, I'd appreciate it.

Thanks 🙂

iMac, Mac OS X (10.6.4)

Posted on Aug 17, 2010 6:32 AM

Reply
Question marked as Top-ranking reply

Posted on Aug 25, 2010 6:03 AM

After running ./configure
edit linker flags in Makefile and add -lresolv to it:

LDFLAGS=-L. -Lopenbsd-compat/ -fstack-protector-all -mmacosx-version-min=10.4 -lresolv
7 replies

Sep 1, 2010 4:25 AM in response to twmjr

Thanks for that...that got me through compiling! I've now run into another snag...it seems there is some problem with ssh-agent usage when recompiling OpenSSH from source. The following is a debug output with SSH AUTHSOCK set to the default (/tmp/launch-hdTE8H/Listeners in this case)


sh-3.2# ssh -vl user and IP redacted
OpenSSH_5.6p1, OpenSSL 0.9.8l 5 Nov 2009
debug1: Reading configuration data /usr/etc/ssh_config
debug1: Connecting to x.x.x.x [x.x.x.x] port 22.
debug1: Connection established.
debug1: permanently setuid: 0/0
debug1: identity file /var/root/.ssh/id_rsa type -1
debug1: identity file /var/root/.ssh/id_rsa-cert type -1
debug1: identity file /var/root/.ssh/id_dsa type -1
debug1: identity file /var/root/.ssh/id_dsa-cert type -1
debug1: Remote protocol version 1.99, remote software version Cisco-1.25
debug1: no match: Cisco-1.25
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.6
debug1: SSH2 MSGKEXINIT sent
debug1: SSH2 MSGKEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: sending SSH2 MSG_KEXDHINIT
debug1: expecting SSH2 MSG_KEXDHREPLY
debug1: Host 'x.x.x.x' is known and matches the RSA host key.
debug1: Found key in /var/root/.ssh/known_hosts:1
debug1: ssh rsaverify: signature correct
debug1: SSH2 MSGNEWKEYS sent
debug1: expecting SSH2 MSGNEWKEYS
debug1: SSH2 MSGNEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2 MSG_SERVICEREQUEST sent
debug1: SSH2 MSG_SERVICEACCEPT received

The connection hangs here until terminated. By changing $SSH AUTHSOCK to 0, the connection goes through without a hitch. I have tried the following things:

- Building completely from the source downloaded at opensource.apple.com (configure - make- make install)
- Building completely from the source of the most recent code version from OpenSSH directly
- Running make - make install on the main directory from opensource.apple.com (There is a Makefile already in place)

All three of these methods end up in the same problem - connection hangs unless you force $SSH AUTHSOCK to 0.

Any advice is most appreciated. 🙂

Sep 1, 2010 10:39 AM in response to etresoft

Right, from what I understand, it should be started by launchd when required. This does not seem to be happening:


localhost:~ twmjr$ ps -A | grep ssh
80444 ttys000 0:00.01 ssh -vl [USERNAME] [IP ADDRESS]

ssh-agent doesn't seem to start at all. this output is from while my session is hanging at the point indicated earlier. another thing to note is that ssh-add simply hangs when run...

Compiling OpenSSH

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.