PLBFTP_USER Keyword


10.4

PLBFTP_USER_{username}={password},{permissions}[,{path}]

 

This keyword defines a user name, password, permissions, and optional path for accessing the PWS FTP Server.

 

These keywords can be added, modified, or removed real time without having to restart the PWS server. This gives a dynamic mode of usage when managing FTP users who can access the PWS FTP Server.

Where:

username
Required The {username} is the name provided by a client accessing the PWS FTP Server. The {username} must be less than fifty (50) characters long. The {username} may be specified as 'anonymous'.
password
Required The {password} is a SHA-1 hashed string of twenty (20) bytes provided as forty (40) hexadecimal characters. If the {username} is specified as 'anonymous' the {password} may or may not be required depending on whether the PLBFTP_ALLOW_ANON keyword is ON. See Note (2) below.
permissions
Optional The {permissions} is provided as a string of uppercase characters that identifies the FTP operations which are allowed for a specified {username}. See Note (1) below.
path
Optional The {path} can be provided to define the OS directory that the FTP client user has access to on the system where the PWS FTP Server is executing. Beware, the FTP client user is limited to access of the {path} directory, subdirectories, and files. The {path} is the new virtual root for this user.

Note:

1.   The {permission} control characters are defined as follows:

 

Character

Allows ...

D

the download of files to the FTP client.

L

a list of files to be sent to the FTP client.

R

rename and remove of files at the PWS FTP Server.

U

upload of files to the server.

P

path change path at the server.

M

ake or remove of directories at the server.

 

2.   The {password} is a SHA-1 hashed string of twenty (20) bytes provided as forty (40) hexadecimal characters. See this link to get SHA-1 Hash encrypted string:

 

https://md5decrypt.net/en/Sha1/

 

This is an example of PL/B code that creates the.forty (40) character hexadecimal string for the {password}.

 

 

UserPW

DIM

50

PassWord

DIM

50

i

NTEGER

1

i4Ar

INTEGER

1(20)

D8

DIM

8

D2

DIM

2

D20

DIM

20

HashHex

DIM

50

xMode

INTEGER

1,"4" //SHA1 with context

// initialization

R

RUNTIME

 

.

 

 

 

WINHIDE

 

 

MOVE

"Password", UserPW

 

HASH

UserPW, PassWord,MODE=xMode

 

UNPACK

PassWord, i4Arr

.

 

 

 

FOR

i, 1, 20

.

 

 

 

R.IntToString

GIVING D20 USING i4Arr(i), 1

 

UNPACK

D20, D8, D2

 

PACK

HashHex, HashHex, D2

.

 

 

 

REPEAT

 

.

 

 

 

ALERT

NOTE,HashHex,i,"HashHex of 'Password'"

 

 

HashHex=8BE3C943B1609FFFBFC51AAD666D0A04ADF83C9D

 

3.   This is an example for a user named 'Test' with a password of 'Password':

 

PLBFTP_USER_TEST=8BE3C943B1609FFFBFC51AAD666D0A04ADF83C9D,DL

  

In this case, the user named 'TEST' with a password of 'Password' has permissions to download files and list files when accessing a PWS FTP Server.

 

 

See Also: PLBWEBSRV Keywords, Server Command Line



PL/B Web Server PLBFTP_SSL_VERSION PLBWEB_ADDRESS