mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
@@ -488,7 +488,12 @@ func startSFTPServer(args []string) {
|
||||
sshConfig.AddHostKey(private)
|
||||
|
||||
handleSFTPSession := func(channel ssh.Channel, sconn *ssh.ServerConn) {
|
||||
server := sftp.NewRequestServer(channel, NewSFTPDriver(sconn.Permissions), sftp.WithRSAllocator())
|
||||
var remoteIP string
|
||||
|
||||
if host, _, err := net.SplitHostPort(sconn.RemoteAddr().String()); err == nil {
|
||||
remoteIP = host
|
||||
}
|
||||
server := sftp.NewRequestServer(channel, NewSFTPDriver(sconn.Permissions, remoteIP), sftp.WithRSAllocator())
|
||||
defer server.Close()
|
||||
server.Serve()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user