-2

I have a shell script that opens ftp, then passes on the user ID and password. The password starts with ( and the server does not like it. It errors outs with a failure to log in message. How can I get past this, without having to change the password? I tried single quotes and that failed also.

closed as unclear what you're asking by Kusalananda, RalfFriedl, roaima, G-Man, maxschlepzig Nov 24 '18 at 12:44

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    Unclear: Does not show what they are doing. Does not mention what FTP client is used on what Unix. – Kusalananda Nov 23 '18 at 17:08
  • 1
    pastebin a copy of the script minus your user/server/ip information. Please. – Michael Prokopec Nov 23 '18 at 17:43
2

You can use .netrc file (located in your home directory). At least most of ftp clients can use the information in this file for authentication purpose. The format is:

machine example.com
login <username>
password <password>

You should replace <username> with your username and <password> with your password.

The only disadvantage is the username and the password will be visible to anyone who can read the file.

Not the answer you're looking for? Browse other questions tagged or ask your own question.