fix(sftp): add port

pull/948/head
Xhofe 2022-04-12 20:22:09 +08:00
parent 30ebb0f4d4
commit 37b42e6e17
1 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,7 @@
package template
import (
"fmt"
"github.com/Xhofe/alist/conf"
"github.com/Xhofe/alist/drivers/base"
"github.com/Xhofe/alist/model"
@ -23,7 +24,7 @@ func GetClient(account *model.Account) (*Client, error) {
if v, ok := clientsMap.clients[account.Name]; ok {
return v, nil
}
conn, err := ssh.Dial("tcp", account.SiteUrl, &ssh.ClientConfig{
conn, err := ssh.Dial("tcp", fmt.Sprintf("%s:%d", account.SiteUrl, account.Limit), &ssh.ClientConfig{
User: account.Username,
Auth: []ssh.AuthMethod{ssh.Password(account.Password)},
HostKeyCallback: ssh.InsecureIgnoreHostKey(),