Source From Here
Question
A server allows SSH connections, but not using public key authentication. It's not within my power to change this at the moment (due to technical difficulties, not organizational) but I will get on it as soon as possible! What I need now is to execute commands on the server using plain old account+password authentication from a script. That is, I need to do it in a non-interactive way. Is it possible? And how do I do it?
How-To
There is a linux utility called sshpass. It allows you to do exactly what you want and will take a server password either as a command line argument, or from a file (i prefer this way, so i do not have my server password show up in shell history) and you use it like so:
This will ssh into a server and run ls -la. One thing, however, you have to manually ssh into a server first (if you haven't done so already), so the server gets added to your ~/.ssh/known_hosts. If you don't do that, sshpass will not work.
Supplement
* nixCraft - sshpass: Login To SSH Server / Provide ... Password Using A Shell Script
* [Linux 文章收集] sshpass Command : Non-interactive Password Authentication with SSH
This is a blog to track what I had learned and share knowledge with all who can take advantage of them
標籤
- [ 英文學習 ]
- [ 計算機概論 ]
- [ 深入雲計算 ]
- [ 雜七雜八 ]
- [ Algorithm in Java ]
- [ Data Structures with Java ]
- [ IR Class ]
- [ Java 文章收集 ]
- [ Java 代碼範本 ]
- [ Java 套件 ]
- [ JVM 應用 ]
- [ LFD Note ]
- [ MangoDB ]
- [ Math CC ]
- [ MongoDB ]
- [ MySQL 小學堂 ]
- [ Python 考題 ]
- [ Python 常見問題 ]
- [ Python 範例代碼 ]
- [心得扎記]
- [網路教學]
- [C 常見考題]
- [C 範例代碼]
- [C/C++ 範例代碼]
- [Intro Alg]
- [Java 代碼範本]
- [Java 套件]
- [Linux 小技巧]
- [Linux 小學堂]
- [Linux 命令]
- [ML In Action]
- [ML]
- [MLP]
- [Python 學習筆記]
- [Quick Python]
- [Software Engineering]
- [The python tutorial]
- 工具收集
- 設計模式
- 資料結構
- ActiveMQ In Action
- AI
- Algorithm
- Android
- AWS
- Big Data 研究
- C/C++
- C++
- CCDH
- Coursera
- Database
- DB
- Design Pattern
- Device Driver Programming
- Docker
- Docker 工具
- Docker Practice
- Eclipse
- English Writing
- ExtJS 3.x
- FP
- FreeBSD
- GCC
- Git
- Git Pro
- GNU
- Gradle
- Groovy
- Hadoop
- Hadoop. Hadoop Ecosystem
- Java
- Java Framework
- Java UI
- JavaIDE
- JavaScript
- JFreeChart
- Kali/Metasploit
- Keras
- KVM
- Learn Spark
- Linux
- Lucene
- Math
- ML Udemy
- MPI
- Nachos
- Network
- NLP
- node js
- OO
- OpenCL
- OpenMP
- OSC
- OSGi
- Perl
- PostgreSQL
- Python
- Python Std Library
- Python tools
- QEMU
- R
- RIA
- RTC
- Ruby
- Ruby Packages
- Scala
- ScalaIA
- TensorFlow
- Tools
- UML
- Unix
- Verilog
- Vmware
- Windows 技巧

訂閱:
張貼留言 (Atom)
[ Python 常見問題 ] python generator “send” function purpose?
Source From Here Question Can someone give me an example of why the "send" function associated with Python generator function...

-
來源自 這裡 前言 : Thread 是 threading 模塊中最重要的類之一,可以使用它來創建線程。有兩種方式來創建線程:一種是通過繼承Thread 類,重寫它的 run 方法;另一種是創建一個 threading.Thread 對象,在它的初始化...
-
Preface: 在這個階層中,我們只需考慮電路模組的功能,而不需考慮其硬體的詳細內容. Verilog 的時序控制為以事件為基礎的時序控制: * 接線或暫存器的值被改變。 * 模組的輸入埠接收到新的值 * 正規...
-
Source From Here Preface 本文實例講述了Python中 zip() 函數的定義及用法,相信對於Python初學者有一定的借鑒價值。 一、定義: zip([iterable, ...]) zip() 是 Python 的一個內建...

沒有留言:
張貼留言