ssh: percent_expand: NULL replacement

View: New views
4 Messages — Rating Filter:   Alert me  

ssh: percent_expand: NULL replacement

by Mouse2k :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I upgraded to Leopard and when I tried to ssh into my remote server, I got this error:

percent_expand: NULL replacement

I uninstalled and reinstalled but to no avail. The regular /usr/bin/ssh works fine, so I think it is the port. Anyone else have this issue?

Re: ssh: percent_expand: NULL replacement

by jptix :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The solution to this problem is to use the -i flag when connecting to the server:

ssh user@host -i ~/.ssh/id_dsa

You can also make this permanent for all servers by adding this line to your ~/.ssh/config:

IdentityFile ~/.ssh/id_dsa

The above solution is courtesy of Allan Odgaard, author of the excellent TextMate editor.
He also has a theory about the cause of the problem:

ssh has some default search path for private keys, this string includes escape codes for user name, user folder and such.
so by default it will expand that string to find your key, and on leopard, one of these variables expands to NULL and hence you get that error.
so giving -i «private key» bypasses this search path string.

Re: ssh: percent_expand: NULL replacement

by Winston Tsang :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If you have a rather robust ssh config file, add the following to the bottom of your file:

# Fix Leopard Issue with Null Replacement
Host        *
 IdentityFile ~/.ssh/id_rsa


You can also use id_dsa if that's your preference.

To generate a id_rsa/id_dsa file, use ssh-keygen.

Check the man file, 'man ssh-keygen', for the details.



Re: ssh: percent_expand: NULL replacement

by deesto :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Winston Tsang wrote:
If you have a rather robust ssh config file, add the following to the bottom of your file:
# Fix Leopard Issue with Null Replacement
Host        *
 IdentityFile ~/.ssh/id_rsa

You can also use id_dsa if that's your preference.
To generate a id_rsa/id_dsa file, use ssh-keygen.
Check the man file, 'man ssh-keygen', for the details.
Is something going on with SSH on Leopard?  I never had to use the "-i" flag before today, and suddenly I can't connect without it (or the IdentityFile directive).  A few days ago, I had to add DISPLAY to my bash profile in order to start remote X sessions, when I never needed to before (the system suddenly started forwarding Leopard's '/tmp/' launch path instead of a DISPLAY IP).  I haven't changed any system settings or (knowingly) updated any Mac or SSH software in the past week.