Leis, Benjamin schrieb: > I'm trying to get a scenario working where I SSH into a intermediary server > (via JSCH) and then SSH from there > to a final destination. At the same time I want this processing to occur in > the background. Everything works > fine until I added the nohup step. I added the -v option and compared the two > runs with and without nohup and > it appears that the agent forwarding breaks down in this case: > > My test command: > > nohup ssh -v -f -A -p 22 -o StrictHostKeyChecking=no -o ConnectTimeout=30 -o > UserKnownHostsFile=/dev/null > -o ChallengeResponseAuthentication=no -o PasswordAuthentication=no -o TCPKeepAlive=yes -o CheckHostIP=no > -o ServerAliveInterval=60 10.17.129.3 "bash -c \"touch foo; sleep 10s; > touch foo2\""
Why are you using nohup here? nohup has the effect that the command will not be finished when the parent ssh session (i.e. the session from JSch) is closed. Do you need this? And if the session is closed, how should the agent forwarding work then? Normally when using nohup I always add a '&' to the end of the command line to put everything in the background. > Without nohup specified I see the following: The pkalg key is being > transferred as expected. > > [junit] line: debug1: Next authentication method: publickey > [junit] line: debug1: Offering public key: > [junit] line: debug1: Server accepts key: pkalg ssh-dss blen 433 > [junit] line: debug1: Authentication succeeded (publickey). > > With nohup I see the following instead: > > debug1: Next authentication method: publickey > debug1: Trying private key: /home/benleis/.ssh/identity > debug1: Trying private key: /home/benleis/.ssh/id_rsa > debug1: Trying private key: /home/benleis/.ssh/id_dsa > debug1: No more authentication methods to try. > > Trying this out with ssh from the command line rather than JSCH I see the > keys transfer as expected even when using nohup. > Does anyone know what might be going on? Does "ssh from the command line" means ssh intermediary nohup ssh -v -f ... or does it mean loggin in into a shell and issuing the command from there? Paul ------------------------------------------------------------------------------ Achieve unprecedented app performance and reliability What every C/C++ and Fortran developer should know. Learn how Intel has extended the reach of its next-generation tools to help boost performance applications - inlcuding clusters. http://p.sf.net/sfu/intel-dev2devmay _______________________________________________ JSch-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jsch-users
