File tree Expand file tree Collapse file tree 4 files changed +7
-1
lines changed Expand file tree Collapse file tree 4 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ private Task UpdateConfiguration()
68
68
config . Global . Directories ??= new List < string > ( ) ;
69
69
config . Global . Logging ??= new LoggingDefinition ( ) ;
70
70
config . Global . Chroot ??= new ChrootDefinition ( ) ;
71
+ config . Global . PKIandPassword ??= new string ( "" ) ;
71
72
config . Global . HostKeys ??= new HostKeysDefinition ( ) ;
72
73
config . Global . Hooks ??= new HooksDefinition ( ) ;
73
74
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ public class GlobalConfiguration
7
7
public LoggingDefinition Logging { get ; set ; } = new ( ) ;
8
8
public HostKeysDefinition HostKeys { get ; set ; } = new ( ) ;
9
9
public HooksDefinition Hooks { get ; set ; } = new ( ) ;
10
+ public string PKIandPassword { get ; set ; }
10
11
11
12
public string Ciphers { get ; set ; }
12
13
public string HostKeyAlgorithms { get ; set ; }
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ public class SSHConfiguration
12
12
public string HostKeyAlgorithms { get ; set ; }
13
13
public string KexAlgorithms { get ; set ; }
14
14
public string MACs { get ; set ; }
15
+ public string PKIandPassword { get ; set ; }
15
16
16
17
public override string ToString ( )
17
18
{
@@ -44,6 +45,8 @@ public override string ToString()
44
45
builder . AppendLine ( "# Allowed users" ) ;
45
46
builder . AppendLine ( $ "AllowUsers { string . Join ( " " , AllowUsers ) } ") ;
46
47
builder . AppendLine ( ) ;
48
+ if ( PKIandPassword == "true" ) builder . AppendLine ( "AuthenticationMethods \" publickey,password\" " ) ;
49
+ builder . AppendLine ( ) ;
47
50
builder . AppendLine ( "# Match blocks" ) ;
48
51
foreach ( var matchBlock in MatchBlocks )
49
52
{
Original file line number Diff line number Diff line change @@ -64,7 +64,8 @@ private async Task UpdateConfiguration()
64
64
Ciphers = sftpConfig . Global . Ciphers ,
65
65
HostKeyAlgorithms = sftpConfig . Global . HostKeyAlgorithms ,
66
66
KexAlgorithms = sftpConfig . Global . KexAlgorithms ,
67
- MACs = sftpConfig . Global . MACs
67
+ MACs = sftpConfig . Global . MACs ,
68
+ PKIandPassword = sftpConfig . Global . PKIandPassword
68
69
} ;
69
70
70
71
var exceptionalUsers = sftpConfig . Users . Where ( s => s . Chroot != null ) . ToList ( ) ;
You can’t perform that action at this time.
0 commit comments