DarkMatter in Cyberspace
  • Home
  • Categories
  • Tags
  • Archives

Run Script on Remote Host via SSH


user='bvt' host='10.0.2.47' ssh \(user@\)host 'bash' <<EOF source /etc/profile java -version hostname EOF

You need copy your ssh pub key to target host before hand, or you will have to enter the password at runtime.



Published

Mar 27, 2014

Last Updated

Mar 27, 2014

Category

Tech

Tags

  • Linux 158
  • Shell 46
  • SSH 23

Contact

  • Powered by Pelican. Theme: Elegant by Talha Mansoor