Considerations for FTP server credentials with special characters

Attention: open in a new window. PDFPrintE-mail

FTP server credentials may include special characters that need to be handled in specified manner on the Command Line Interface (CLI).

Special characters also referred to as meta-characters, are members of an exempt set of characters, which when used in command line mode are evaluated as characters with non-literal meaning. These characters are designated to carry out a special instruction, or have an alternate meaning.

NOTE
This list is not exhaustive and alternate meaning for some characters is contextual. For more information, refer to any Linux scripting information available for general use on the internet.

A list of some of the more commonly used special characters and their alternate meaning is as follows:

  • & is used to put a command in background/batch mode.
  • ! is used to recall the last invocation of the command matching the pattern that follows the character.
  • | is used to pipe output to the command that follows the character.
  • ; is used to concatenate multiple bash commands.
  • * is used to represent a wildcard character.
  • ? is used as a match for any single character in the specified position.
  • () is used for integer expansion.
  • <> is used for redirection. < represents input and > represents output.
  • $ is used to represent shell variable.
  • ` is used for command substitution or assign output of a command to a variable.
  • " is used for partial quoting.
  • ' is used for full quoting.
  • Space is used as a separation character.
  • # when preceded by a space, treats all characters till the end of the corresponding line as a comment.

These special characters may be used to enhance the security of the user credentials. However, to interpret these characters properly in the CLI mode, you must follow one of the following methods:

  • Escape each instance of the special character by preceding it with the escape character (\).
  • Enclose the credentials containing special characters, with single quotes.

If single quotes are themselves part of the credential, precede each instance of the single quote with the escape character (\). Alternately, the string may be enclosed in double quotes if more intricate bash substitution is desired to further strengthen the security measure of the credentials.

For detailed information on using the special characters in the credentials, refer to any Linux scripting information available for general use on the internet.

You can test the representation of the credentials using the echo tests.

Examples to verify the use of special characters

To verify the use of single quote for the password aaa!01:
switch:admin> echo ‘aaa!01’
aaa!01
To verify escaping ! without quotes for the password aaa!01:
switch:admin> echo aaa\!01
aaa!01
To verify using the quotes, excluding the \! for password aaa!01:
switch:admin> echo "aaa"\!"01"
aaa!01
To verify using the quotes without excluding the \! for password aaa!01, resulting in different password pattern:
switch:admin> "aaa\!01"
aaa\!01 
To verify using the quotes around the \! for password aaa!01, resulting in different password pattern:
switch:admin> echo ‘aaa!01’
aaa!01