Ssh – nodename nor servname provided, or not known

mac-osxssh

I can use this command on my Mac before

ssh `cat /my/login/host`

but I got the problem of nodename nor servname provided, or not known now….

If i use

cat /my/login/host

I will get

aloha@8.8.8.8

I also try this :

hello=`cat /my/login/host`

echo $hello # show aloha@8.8.8.8

but …

ssh $hello # nodename nor servname provided, or not known

Any suggestions ?

Best Answer

all ~

I find the solution !

At first , I use this command

cat -v /my/login/host

##show aloha@8.8.8.8^M

so .... this is my problem ~

the solution as below :

cat /my/login/host | tr -d '\015' > /my/login/host_tmp

ssh `cat /my/login/host_tmp`