0

I need to connect to a Remote FTP host via linux command line. When I try #ftp <IP address>, it prompts for username then password.. But I would like to pass username and password in single line, so remote host should not prompt username or password..

I tried passing as #ftp <ip address> <pw.cfg>, but no success. May I know the command how to pass username and password along with IP address to FTP remote host.. Ideally i will be using this command from a linux script.

pw.cfg: text file contains password

1
  • 2
    Don't use ftp, especially over the internet. You are passing passwords in the clear. Either use scp or sftp. Commented Nov 28, 2023 at 11:42

1 Answer 1

0

You can use .netrc file in your home directory. In the file enter record like:

machine machine_name user username password your_password

and when you enter:

ftp machine_name

ftp will user user_name to login and your_password as password

1
  • 1
    Thanks that works charm..I used as machine IP login LOGINUSER password PASSWORD123
    – Ratha
    Commented Nov 28, 2023 at 22:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .