Skip to content

scp with password argument, without fingerprint confirm. Run under both Windows and Linux.

License

Notifications You must be signed in to change notification settings

ActiveVolcano/scp-with-password

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scp with password

No need to confirm fingerprint, no need to type password in keyboard, just put password as command-line argument to scp, suit for using in scripts.

Written in Java, Run under both Windows and Linux.

The recursive (-r) option is not supported yet.

Usage as standalone run

  1. Install Java 11 or above.
  2. Download, unzip from the Releases page.
  3. Run in command prompt, arguments are same as the standard ssh command, plus --password option, like
scp-password --password OpenSesame c:\hello.txt alibaba@192.168.0.1:/tmp

Specify connection timeout in seconds:

scp-password -o ConnectTimeout=10 --password OpenSesame c:\hello.txt alibaba@192.168.0.1:/tmp

or using a new option name to keep the style:

scp-password --connect-timeout 10 --password OpenSesame c:\hello.txt alibaba@192.168.0.1:/tmp

Get full command-line usage:

scp-password --help

Usage as Java package

  • In Maven pom.xml:
    See Packages page.

  • In Java code:

import cn.nhcqc.sshex.Scp;

var config = new Scp.Config ();
//  set config field values
new Scp ().run (config);

License

LGPL-2.1 (GNU Lesser General Public License).

See file LICENSE for details.

How to compile

  1. Install Apache Maven 3
  2. Run
mvn package
  1. In the target folder, those listed below are for standalone run:
    • *.bat
    • *.java
    • *.ini
    • lib

Development Notes

(Dependencies)

sshj

examples
https://github.com/hierynomus/sshj/tree/master/examples/src/main/java/net/schmizz/sshj/examples

com.hierynomus:sshj:0.33.0
https://search.maven.org/artifact/com.hierynomus/sshj

<dependency>
  <groupId>com.hierynomus</groupId>
  <artifactId>sshj</artifactId>
  <version>0.33.0</version>
</dependency>

Apache Commons CLI

Using
https://commons.apache.org/proper/commons-cli/usage.html

<dependency>
  <groupId>commons-cli</groupId>
  <artifactId>commons-cli</artifactId>
  <version>1.5.0</version>
</dependency>

SLF4J

user manual
https://www.slf4j.org/manual.html

java.util.logging

config file
http://www.javapractices.com/topic/TopicAction.do?Id=143

About

scp with password argument, without fingerprint confirm. Run under both Windows and Linux.

Resources

License

Stars

Watchers

Forks

Packages