Automate ftp session without bare password being seen
Hi all,
I need to ftp some files nightly from my linux box to an arbituary ftp server not controlled by me. The ftp server admin has granted me an account for the purpose, but do not wish me to store the plain username or password in any script files for security reasons. How can I do that? the wrong way would be: Code:
$ cat my_script p.s. I could request the ftp username of my choice though. |
If you chmod your script 700 then only you can read it or execute it.
FTP passes the username and password in plain text anyway. Better off using scp. |
there is a solution which is scp and key based authentication
first you have to generate public keys using command: ssh-keygen key geneterd would be at ~/.ssh/ than you have to copy your public keys to that systems and save your keys at remote machine: ~/.ssh/authorized_keys then verify it by ssh username@IP_Address it will not ask for password then you can use command to copy data scp file.txt username@IP_address: first test all this things then you can also set cron job. |
Hi Jerry Mcguire,
I agree SSH better implements this, as said by sohail0399. If you have only access to ftp then here are few tips to you. Apart from 700 permission, you may use encryption before you open and write that file in vi. Open the file this way Code:
vi -x my_script This is just a way to protect your file. But the data will be sent unencrypted in the network |
May I ask, how would the admin know if you saved the passwords or not?
|
Quote:
|
Quote:
|
Not solved yet.
Storing the password in plain text is prohibited by company policy. Quote:
Quote:
|
ok fine
if you want use only script of FTP then you can also save the password in the script and encryption is also possible, i have used it for telnet script i have also tested "vi -x my_script" its encrypted the file but script can not be run so may be this would helpful to you check this link: http://www.linuxsecurity.com/content...117920/49/1/1/ |
All times are GMT -5. The time now is 07:09 PM. |