Skip to content

Commit

Permalink
scp по ключам (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
asosnoviy authored Jun 20, 2018
1 parent c20d0ce commit 9de398c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
11 changes: 11 additions & 0 deletions NUnitTests/Tests/external.os
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,17 @@
Scp.ОтправитьФайл("C:\DEVELOP\Oscript\oscript-ssh\.ssh\testfile", "./testfile");

Scp.Разорвать();


Либа = Новый КлиентSSH("127.0.0.1", 2222, "user", "");
Либа.УстановитьКлюч("C:\DEVELOP\Oscript\oscript-ssh\.ssh\testkey", "");
Scp = Либа.ПолучитьScp();

юТест.ПроверитьРавенство(ТипЗнч(Scp), Тип("СоединениеSCP"), "Не получилось scp");
Scp.ОтправитьФайл("C:\DEVELOP\Oscript\oscript-ssh\.ssh\testfile", "./testfile");

Scp.Разорвать();


Либа = Новый КлиентSSH("127.0.0.1", 1543, "admin", "");
Scp = Либа.ПолучитьScp();
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 0.4.1.{build}
version: 0.4.2.{build}
environment:
main_project: oscript-component
before_build:
Expand Down
14 changes: 12 additions & 2 deletions oscript-component/ClientSSH.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,19 @@ public Connection Create()
public Scp CreateScp()
{

var scpclient = new SftpClient(_host, _port, _user, _pass);
return new Scp(scpclient);
if (_keyFileIsset)
{

var scplient = new SftpClient(_host, _port, _user, _keyfile);
return new Scp(scplient);

}
else
{
var scplient = new SftpClient(_host, _port, _user, _pass);
return new Scp(scplient);
}

}


Expand Down
2 changes: 1 addition & 1 deletion packagedef
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Описание
.Имя("ClientSSH")
.Версия("0.4.1")
.Версия("0.4.2")
.Автор("a.sosnoviy aka lab")
.АдресАвтора("[email protected]")
.Описание("ssh client для oscript")
Expand Down

0 comments on commit 9de398c

Please sign in to comment.