We are migrating from FTP to SFTP. We used the following script for FTP:
This code needs to be converted to SFTP code.
The admin people have generated some private and public keys, but I don't know where to place it. Assuming that I have to move files from Server A to Server B, can someone please let me know where to place the keys. Also what changes need to be made to the script to make it work with SFTP?
Many thanks for the quick reply. Yes you are right, the script is kind of silly, but thats how the system was designed in the first place. So they exported everything in a file, then ran the file.
I am sure that the script that you wrote will definitely solve my problem, but for passwordless authentication we need to keep the public key and private key generated for a user to a particular directory in either Server A or Server B or both. Now I am not sure where the files should be kept (its someting like /.ssh/xxx). Can you please let me know the exact locations where the files should be kept to enable passwordless authentication?
Under $USERNAME/.ssh. Set file permissions to 0600 and directory permissions to 0700.
You mean that if I need to move files from Server A (which has the SFTP daemon) to Server B, I need to place the public key in /home/<user>/.ssh/ in Server B?
The private key must go on the machine you're running 'sftp username@host' upon. The machine you're logging into, only gets the public key listed in ~/.ssh/authorized_keys.
If you have it, the ideal way would be to just put the keys on the client machine, then 'ssh-copy-id username@host' to copy everything exactly as needed onto the server.
It's difficult to give exact, precise instructions since you didn't tell me what kind of key files you were given when asked(dsa, rsa, other?), just repeated the vague nebulous 'files'... But see passwordless logins with openssh and skip the key-generation steps to see what you need to do.
Last edited by Corona688; 07-03-2013 at 12:17 PM..
These 2 Users Gave Thanks to Corona688 For This Post:
I'm New to AIX / VIOS
We're doing a FC switch cutover on an ibm device, connected via SAN.
How do I tell if one path to my remote disk is lost? (aix lvm)
How do I tell when my link is down on my HBA port?
Appreciate your help, very much! (4 Replies)
Hi all.
I can put ftp command in shell script together with the password using
ftp -n 10.1.2.34 << EOF
user userid password
cd /test_dir/
prompt
bin
get filename.txt
EOF
But the -n option is not available for sftp.
What alternatives do I have then to bypass the password prompt?
... (6 Replies)
Hi Friends,
I need to make a Unix script, where i need ftp and sftp functionality.
Let me describe in details:
I need to import few files from remote server, now these remote server either support ftp or sftp not both. So i need a script where my script will try to do ftp first and if it... (8 Replies)
Hi All,
I am in the process of replacing SFTP instead of FTP to make data more secure. In one of my FTP script I have Quote Site command. I would like to know, what is the option to replace this in SFTP
ftp -n -v <<! | tee -a $LOG | grep "Transfer complete" >/dev/null
open... (3 Replies)
Hi,I am using following code for FTP in shell script file and it is working.Now I want to migrate from FTP to SFTP.What code changes/steps I have to perform for SFTP ?
ftp -in <<FIN
open $SAP_UP_SERVER
user $SAP_UP_USER $SAP_UP_PASSWORD
asc
put... (7 Replies)
Somebody made a policy that 'we use sftp now instead of ftp'. I have recommended we use scp because I can't for the life of me think of a *good* reason to use sftp and not scp. But most of what I do is stupid stuff without a good reason. I get judged on how much I can just say yes, no matter how... (1 Reply)
Good morning all,
I require some help regarding an FTP server i am building.
Basically i have around 20 users all sending a receiving files to and from my FTP server but would like all traffic to be secure. I want to ensure users connect via SFTP only and are denied via FTP.
Im using... (1 Reply)
Hi,
I'm being told that I have to start using SFTP from my server (HPUX 11i), so heres a few questions;
What are the differences between FTP and SFTP? What differences in congiuration can I expect? Are there any changes in command usage? I did see an earlier thread with command issues. A few... (3 Replies)