remote deploy or remote executive
2016-01-21 15:35
309 查看
refs:
http://stackoverflow.com/questions/5162568/linux-execute-command-remotely http://serverfault.com/questions/241588/how-to-automate-ssh-login-with-password http://stackoverflow.com/questions/12202587/automatically-enter-ssh-password-with-script http://stackoverflow.com/questions/19996089/use-ssh-to-start-a-background-process-on-a-remote-server-and-exit-session
ssh自动输入密码
ssh 执行远程指令后不会立刻返回,可用 -f 来实现。
The "-f" option to ssh tells ssh to run the remote command in the background and to return immediately. E.g.,
ssh -f user@host "echo foo; sleep 5; echo bar"
If you type the above, you will get your shell prompt back immediately, you will then see "foo" output. Five seconds later you will then see "bar" output. In the meantime, you could have been using the shell.
无效?
http://stackoverflow.com/questions/5162568/linux-execute-command-remotely http://serverfault.com/questions/241588/how-to-automate-ssh-login-with-password http://stackoverflow.com/questions/12202587/automatically-enter-ssh-password-with-script http://stackoverflow.com/questions/19996089/use-ssh-to-start-a-background-process-on-a-remote-server-and-exit-session
ssh -OPTIONS -p SSH_PORT user@remote_server "remote_command1; remote_command2; remote_script.sh"
ssh user@machine 'bash -s' < local_script.sh or you can just ssh user@machine "remote command to run"
ssh自动输入密码
First you need to install sshpass. Ubuntu/Debian: apt-get install sshpass Fedora/CentOS: yum install sshpass Arch: pacman -S sshpass SSHPASS EXAMPLE: sshpass -p "YOUR_PASSWORD" ssh -o StrictHostKeyChecking=no YOUR_USERNAME@SOME_SITE.COM SSHPASS CUSTOM PORT EXAMPLE: sshpass -p "YOUR_PASSWORD" ssh -o StrictHostKeyChecking=no YOUR_USERNAME@SOME_SITE.COM:2400
ssh 执行远程指令后不会立刻返回,可用 -f 来实现。
The "-f" option to ssh tells ssh to run the remote command in the background and to return immediately. E.g.,
ssh -f user@host "echo foo; sleep 5; echo bar"
If you type the above, you will get your shell prompt back immediately, you will then see "foo" output. Five seconds later you will then see "bar" output. In the meantime, you could have been using the shell.
无效?
相关文章推荐
- slice
- 折半查找确定插入数组中元素的位置
- 【慕课笔记】第五章 阶段练习 第3节 使用Eclipse调试程序
- while 循环
- while 循环2
- 判断单链表是否有环(C++)
- java对象---序列化与反序列化
- 2661: [BeiJing wc2012]连连看
- 浏览器地址栏欺骗漏洞背后
- Xcode7.2 No such module 'Cocoa'问题
- Closures--闭包
- 正则表达式
- java 执行bat批处理文件 并关闭cmd窗口
- 用HorizontalScrollView实现listview的左右滑动
- XMPP协议的原理介绍
- C各个类型的大小
- c#设计模式-单例模式(面试题)
- extjs combobox 如何获取点击事件
- ORA-01565: error in identifying file '+DATA/ORACLE/spfileORACLE.ora'
- leetcode之happy number