TScSFTPServer - RootPath (HomePath) for User
Posted: Tue 11 Feb 2014 10:57
Hi,
using the TScSFTPServer via TScSSHServer (6.2): it look's like:
SFTPServer := TScSFTPServer.Create(nil);
ScFileStorage := TScFileStorage.Create(nil);
ScSSHServer := TScSSHServer.Create(nil);
ScSSHServer.SFTPServer := SFTPServer;
ScSSHServer.Storage := ScFileStorage;
..... Port 22 --- Options ect.
then:
scUser := TScUser.Create(ScFileStorage.Users);
scUser.UserName := 'User1';
scUser.Password := '123456';
scUser.Authentications := [uaPassword];
scUser.HomePath := 'C:\Home\User1';
****
Running this Code (maybe in "SimpleSSHServer-Demo") and Login via WinSCP (Connection SFTP)
--- Results after login:
1. in WinSCP I see the 'C:\Home\User1' Folder - OK
2. The Folder 'C:\Home\User1' is not the Root-Folder - !Ok
3. User1 can Change to the topfolders .. "C:\Home" - "C:\" .... - !Ok
4. Get a file from this Folder - OK
5. Save a file to this Folder - !Ok (WinSCP - error-message)
- path to copy is "C:\Home\User1\./*.*"
- error mess is : Can't create the file -> bad filename (code 4)
Where is the mistake? How can I solve this problem?
May be it is a bug in WinSCP:
- when I change the directory in WinSCP to "/"[Root] then the protocol works fine
- may be -- set "OnGetAbsolutePath" for ever "on Root"
Andy
Session = SSH-2
Implementation = Devart-6.0
algorithm = aes
Compression = No
Protocol = SFTP-5
using the TScSFTPServer via TScSSHServer (6.2): it look's like:
SFTPServer := TScSFTPServer.Create(nil);
ScFileStorage := TScFileStorage.Create(nil);
ScSSHServer := TScSSHServer.Create(nil);
ScSSHServer.SFTPServer := SFTPServer;
ScSSHServer.Storage := ScFileStorage;
..... Port 22 --- Options ect.
then:
scUser := TScUser.Create(ScFileStorage.Users);
scUser.UserName := 'User1';
scUser.Password := '123456';
scUser.Authentications := [uaPassword];
scUser.HomePath := 'C:\Home\User1';
****
Running this Code (maybe in "SimpleSSHServer-Demo") and Login via WinSCP (Connection SFTP)
--- Results after login:
1. in WinSCP I see the 'C:\Home\User1' Folder - OK
2. The Folder 'C:\Home\User1' is not the Root-Folder - !Ok
3. User1 can Change to the topfolders .. "C:\Home" - "C:\" .... - !Ok
4. Get a file from this Folder - OK
5. Save a file to this Folder - !Ok (WinSCP - error-message)
- path to copy is "C:\Home\User1\./*.*"
- error mess is : Can't create the file -> bad filename (code 4)
Where is the mistake? How can I solve this problem?
May be it is a bug in WinSCP:
- when I change the directory in WinSCP to "/"[Root] then the protocol works fine
- may be -- set "OnGetAbsolutePath" for ever "on Root"
Andy
Session = SSH-2
Implementation = Devart-6.0
algorithm = aes
Compression = No
Protocol = SFTP-5