cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Observer
Observer
6,769 Views
Registered: ‎09-21-2011

SmartXplorer - Password-less SSH - Client/Sever Usernames

Jump to solution

Hello,

 

I'm running ISE 14.3 (P.40xd) on both a RHEL6 server and a Ubuntu 11.04 Natty VM (Oracle VirtualBox) client.  I want to use the server for SmartXplorer runs from the client and all requirements are met for doing this over linux except for the password-less ssh requirement.

 

I can generate public/private key pair for the client and share with the server fine and connect password-less ssh sessions from the client VM to the server, but I don't have control over the usernames on the client and server and Xilinx appears to be using the username of the client to connect to the server.

 

To clarify, I need to connect to the server account <server_username>@<servername> from a client: <client_username>@<clientmachine>.

Xilinx is sending the ssh request to connect to <client_username>@<servername>, which fails because there is no <client_username> account on the server.

 

I'm not super familiar with password-less SSH, so there might be some fancy workaround, but otherwise how do I get Xilinx to specify the server-side username instead of just using the client-side username?

 

 

Thanks,

JoRyTe

 

 

 

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Scholar
Scholar
8,609 Views
Registered: ‎07-01-2008

This is possible with a little trickery. The problem is that if the hostfile contains "username@hostname" it fails when SmartXplorer tries to ping the host using the full entry in the host file. What you can do is spoof SmartXplorer  into running a script that echoes back the expected results of the ping command. The downside of this is that if a host is down, SmartXplorer will still try to submit a job to it. You'll need to check that manually.

 

1. Create a script. I used a csh script named "ping":

#!/bin/csh -f
echo "2 packets transmitted, 2 received, 0% packet loss, time 1000ms"
echo "rtt min/avg/max/mdev = 0.296/0.338/0.380/0.042 ms"

2. Alias ping to the script:

alias ping '~bwade/bin/ping'

 

3. Change your hostfile entry to "username@hostname"

 

-------------------------------------------------------------------------------
Strategy Name         Host Name       Output  Status     Timing   Total
                                                         Score    Run Time
-------------------------------------------------------------------------------
MapRunTime            bwade@xcoapps53 run1    Done       152      0h 3m 4s
MapLogicOpt           bwade@xcoapps52 run2    Done       152      0h 4m 50s
MapGlobOptIOReg       bwade@xcoapps53 run3    Done       152      0h 4m 46s
MapRegDup             bwade@xcoapps52 run4    Routed     0        0h 4m 37s
MapExtraEffortIOReg   bwade@xcoapps53 run5    Mapping    None     0h 1m 21s
MapLogOptRegDup       None            None    None       None     None
MapExtraEffort2       None            None    None       None     None

 

 

View solution in original post

7 Replies
Highlighted
Scholar
Scholar
8,610 Views
Registered: ‎07-01-2008

This is possible with a little trickery. The problem is that if the hostfile contains "username@hostname" it fails when SmartXplorer tries to ping the host using the full entry in the host file. What you can do is spoof SmartXplorer  into running a script that echoes back the expected results of the ping command. The downside of this is that if a host is down, SmartXplorer will still try to submit a job to it. You'll need to check that manually.

 

1. Create a script. I used a csh script named "ping":

#!/bin/csh -f
echo "2 packets transmitted, 2 received, 0% packet loss, time 1000ms"
echo "rtt min/avg/max/mdev = 0.296/0.338/0.380/0.042 ms"

2. Alias ping to the script:

alias ping '~bwade/bin/ping'

 

3. Change your hostfile entry to "username@hostname"

 

-------------------------------------------------------------------------------
Strategy Name         Host Name       Output  Status     Timing   Total
                                                         Score    Run Time
-------------------------------------------------------------------------------
MapRunTime            bwade@xcoapps53 run1    Done       152      0h 3m 4s
MapLogicOpt           bwade@xcoapps52 run2    Done       152      0h 4m 50s
MapGlobOptIOReg       bwade@xcoapps53 run3    Done       152      0h 4m 46s
MapRegDup             bwade@xcoapps52 run4    Routed     0        0h 4m 37s
MapExtraEffortIOReg   bwade@xcoapps53 run5    Mapping    None     0h 1m 21s
MapLogOptRegDup       None            None    None       None     None
MapExtraEffort2       None            None    None       None     None

 

 

View solution in original post

Highlighted
Observer
Observer
6,727 Views
Registered: ‎09-21-2011

Thanks, this is a clever solution.  I've done as you suggested but can't quite qet SmartXplorer to be fooled.

 

Via the GUI I kept getting the message: "WARNING: Unable to ping remote host username@hostname.  Removing host from hostlist".

 

I moved to command line and saw the additional message: "ping: unknown host username@hostname".

It appears that despite adding the alias to my .bashrc, logging out/in, and verifying the correct alias via a new instance of terminal, it still is referencing the actual ping binary.

 

So, I backed up the binary pointed to by "which ping" and replaced it with my ping script.  Now when I run SmartXplorer via terminal the ping unknown host message disappears but Xilinx still reports being unable to ping the server.

 

I have tried echoing from my ping file the lines as you have them as well as actual lines from successful pings to the machine, since my ping output is formatted differently from yours.  The only mod I make to the actual ping output is to replace all instances of <servername> with <username@servername>.

 

Any ideas why SmartXplorer is still rejecting my ping?

 

JoRyTe

0 Kudos
Highlighted
Scholar
Scholar
6,716 Views
Registered: ‎07-01-2008

I'm not sure what could be wrong. If SmartXplorer is tricked into running the script instead of ping, I would expect that to work. Maybe SmartXplorer is using return codes from ping and that's behaving differently in your bash environment. You could try running SmartXplorer from a csh script.

0 Kudos
Highlighted
Observer
Observer
6,706 Views
Registered: ‎09-21-2011

I converted the ping script over to csh and replace the script in /bin/ping.  I then (installed and) lauched a csh prompt and executed a script I wrote which sets the Xilinx environment and executes the smartxplorer command the GUI prints out.  No luck, same unable to ping warning...

0 Kudos
Highlighted
Scholar
Scholar
6,697 Views
Registered: ‎07-01-2008

Try setting a csh alias for ping within your csh script:

alias ping '/your/path/ping'

 

I did this because I couldn't get it to use the ping script with the PATH variable alone.

 

There's still the question of what SmartXplorer actually expects back from ping. It seems unlikely but maybe that varies based on the machine or network. I'll ask somebody that would know.

0 Kudos
Highlighted
Observer
Observer
6,684 Views
Registered: ‎09-21-2011

I tried setting the alias in the csh script I created to launch SmartXplorer and still no success.

 

For sake of debugging, I moved to a system that I didn't have the username complication on just to see if I could bypass ping in a known working environment.

 

I ran a system through SmartXplorer and verified I could connect to the same server as before.  I then created a wrapper for ping to see if I could get ping to pass without calling it in the normal way.

 

Back in Bash...

 

mv /bin/ping /bin/ping.bckp

echo "#!/bin/bash" > /bin/ping

echo "/bin/ping.bckp $1" >> /bin/ping

chmod +x /bin/ping

 

Att his point, executing "ping hostname" looks and acts just like the real ping, since the real ping is getting called in the wrapper.  Run the SmartXplorer system again... no go.  Same "Unable to ping" warning.

 

I try changing my ping script from "/bin/ping.bckp $1" to "exit 0" and still no luck, it doesn't look like SmartXplorer is looking just at the return value.

 

Echoed $@ to see the full list of parameters it is getting called with to discover it is "-q -c2 servername".

 

Changed the ping script back to containing:

 

#!/bin/bash

/bin/ping.bckp -q -c2 servername

 

and SmartXplorer is happy.  Still haven't figured out why replaying the ping echo didn't work, but actually pinging is better anyway.  If I need to use this with multiple servers AND ensure the servers are all alive, I can try to change my ping wrapper to parse any "username@" out of the parameters before passing them to ping.bckp and then pass the full, original parameter list to ping.bckp. Thus, ping will still be fully functional but have the added benefit of accepting "username@servername" input also.

 

 

 

Thanks for the great idea, I'm good to go now.

 

JoRyTe

 

 

 

 

 

 

0 Kudos
Highlighted
Scholar
Scholar
6,679 Views
Registered: ‎07-01-2008

Very nice solution. I first developed the ping spoof to help a customer whose network had ping disabled for some reason so a wrapper wasn't the answer. In hindsight, that's just what you needed instead of the spoof. For future reference, there are debug log files in the .smartxplorer directory under your project directory. That might also have helped with getting this to work.

0 Kudos