Exit SSH from the script
I Want to exit ssh:
How does the below line work:
ssh -f -T ${USAGE_2_USER}@${USAGE_2_HOST}
Or do i need to write it some other way . Please tell should I use exit with ssh an how?
I am using ssh in my script . I want to exit from it after the execution of it, with out showi开发者_如何学Pythonng them up in the proccess.
Your question is very vauge, so I will answer it based on what you asked.
ssh -f -T ${USAGE_2_USER}@${USAGE_2_HOST} ${CMD}
this would ssh as the user assigned to ${USAGE_2_USER}
to the host assigned to ${USAGE_2_HOST}
and then run whatever you have assigned to ${CMD}
and then return the output and then exit.
risk@DockMaster:~$ ssh oracle@orc017a uptime
13:17:41 up 9 days, 13:54, 7 users, load average: 1.67, 2.19, 2.11
risk@DockMaster:~$
As a side note is the -f -T
needed?
精彩评论