I am very new in shell scripting , i want to download some files from linux remote server ,so how can i proceed for that.That remote server is ssh based .
Asked
Active
Viewed 3,119 times
1 Answers
-1
first of all, ftp service is better choice to get files from remote server.
If only sshd service is available, then you may use ssh based command sftp
or scp
.
However, using sftp
or scp
commands will invoke an interactive password prompt, which is a problem in shell script --> You have to ask for help to expect
command. see Automate scp file transfer using a shell script .
Besides expect
, you may also set up trust relationship between two servers, then you may use scp
without password. See http://www.linuxproblem.org/art_9.html
-
11) `FTP` is not a better choice than `SFTP`, what makes you say that? [`FTP` must die!](http://mywiki.wooledge.org/FtpMustDie) 2) Passwords can (and should) be avoided using public-key authentication (and an `FTP`-account would also typically be password-protected); using `expect` with `SSH` is bad advice. – Adrian Frühwirth Apr 24 '14 at 07:03