1834936 Members
2269 Online
110071 Solutions
New Discussion

Re: ssh_config format

 
Francois LAURENT
Frequent Advisor

ssh_config format

I all,

I try to configure ssh a.03.81.002 on 11.11 box, but i have a format problem in ssh_config file.

Keys are "user" and "user.pub" stored in /home/user/.ssh/ dir.

I want to use user dependent key name. So i tried to setup in ssh_config file in client's file :

IdentityFile $HOME/.ssh/$LOGNAME --> don't work
IdentityFile %h/.ssh/%u --> don't work

And then hard path for one test user :
IdentityFile /home/xxx/.ssh/xxx
with xxx a real user with keys --> IT'S WORKING !

Could you help me in telling me what is the format of "IdentityFile" for user dependent name ?

Thanks a lot for help

Regards.

Francois
6 REPLIES 6
Denver Osborn
Honored Contributor

Re: ssh_config format

Your syntax looks good, except for the env variables being used... don't use the varables. :)

It sounds to me that you're making the user changes to the system wide ssh_config /opt/ssh/etc/ssh_config rather than the user's ssh_config.

create $HOME/.ssh/ssh_config for that user. This file will only affect this user and not everyone on the box. Change the global ssh_config back to the default.

Also make sure that te user owns the $HOME/.ssh/ssh_config file and group/other aren't allowed write access.

Hope this helps,
-denver
Francois LAURENT
Frequent Advisor

Re: ssh_config format

Thanks Denver for your purpose,

the env variables aren't read (they're seted of course, it's ok in shell) but why ?

Putting ssh_config in user's home don't work too.

Thanks for any suggestions.

Regards.

Francois
Francois LAURENT
Frequent Advisor

Re: ssh_config format

last try :

ssh -i $HOME/.ssh/$LOGNAME server --> IS WORKING

with tusc -e trace :
grep -e HOME -e LOGNAME /tmp/tusc_ssh-i
env[5] @ 0x77ff043e: "LOGNAME=x051104"
env[13] @ 0x77ff04c8: "HOME=/home/system/x051104"
open("$HOME/.ssh/$LOGNAME", O_RDONLY|O_LARGEFILE, 0) ............... ERR#2 ENOENT
open("$HOME/.ssh/$LOGNAME", O_RDONLY|O_LARGEFILE, 0666) ............ ERR#2 ENOENT
open("$HOME/.ssh/$LOGNAME", O_RDONLY|O_LARGEFILE, 0666) ............ ERR#2 ENOENT
open("$HOME/.ssh/$LOGNAME.pub", O_RDONLY|O_LARGEFILE, 0666) ........ ERR#2 ENOENT




ssh server --> NOT working

with tusc -e trace :
grep -e HOME -e LOGNAME /tmp/tusc_ssh
env[5] @ 0x77ff0419: "LOGNAME=x051104"
env[13] @ 0x77ff04a3: "HOME=/home/system/x051104"
open("$HOME/.ssh/$LOGNAME", O_RDONLY|O_LARGEFILE, 0) ............... ERR#2 ENOENT
open("$HOME/.ssh/$LOGNAME", O_RDONLY|O_LARGEFILE, 0666) ............ ERR#2 ENOENT
open("$HOME/.ssh/$LOGNAME", O_RDONLY|O_LARGEFILE, 0666) ............ ERR#2 ENOENT
open("$HOME/.ssh/$LOGNAME.pub", O_RDONLY|O_LARGEFILE, 0666) ........ ERR#2 ENOENT
stat64("$HOME/.ssh/$LOGNAME", 0x77ff0d18) .......................... ERR#2 ENOENT




In the 2 case : $HOME and $LOGNAME look OK ...


thanks for help.

Regards

Francois
Denver Osborn
Honored Contributor

Re: ssh_config format

oops, sorry about the bad info before. rename $HOME/.ssh/ssh_config to $HOME/.ssh/config

Also use "ssh -vvv" for detailed output. If it's using the specified identity from your user's config, you'll see it.

-denver
Denver Osborn
Honored Contributor

Re: ssh_config format

also remember it won't work (or atleast it didn't work for me) if you put "IdentityFile=$HOME/.ssh/$LOGNAME" in the users $HOME/.ssh/config file. It has to be "IdentityFile=/home/user/.ssh/user". You'll see what I mean when you use the "-vvv" option with ssh for detailed info.

Hope this helps,
-denver
Francois LAURENT
Frequent Advisor

Re: ssh_config format

Hi Denver,

your turn around is ok, putting config file in home dir make my connection ok.
But i'm afraid the solution couldn't been applyed. i have script to create user on multiplaform and only on hpux i have this problem. So i don't want to make a particular case for hp boxes, to preserv equality between different OS.

Thanks a lot for your help
Regards
Francois