Is there an option to put the password on the line as well with sftp?
linux~ $ sftp USERNAME@FTP.WEBSITE.COM:/DIRECTORY_TO_GO_TO/
Like this
linux~ $ sftp USERNAME@FTP.WEBSITE.COM:/DIRECTORY_TO_GO_TO/ -p PASSWORD?
|
Is there an option to put the password on the line as well with sftp?
Like this
|
|||
|
|
|
Generally including a password in a command line is considered a security risk because it will show up to anyone else who can run ps/top, and it may be saved in your shell's history. It would be a much better idea to setup key-based authentication if you are able. Also, I don't believe it is going to be possible with sftp. It is meant to be used for secure transfers. If you really had to do something like this and you have no other choice then you probably need to be looking at automating with expect. |
|||
|
|
|
Don't do that - setup SSH public key authentication for automatic login. |
|||
|
As the other answers have stated, use public key authentication. There is a great, although a little dated, IBM developerWorks series that should explain everything you want to know about it, as well as some useful supplemental tools such as keychain. |
|||
|
|
|
Just use perl or ruby or python to script what you are trying to do. in case of ruby it's just (taken from the net-sftp API docs): require 'net/sftp' Net::SFTP.start('host', 'username', :password => 'password') do |sftp|
end for more info http://net-ssh.rubyforge.org/sftp/v2/api/index.html |
|||
|
|
|
I suspect that there are as many answers as there are FTP clients. An SFTP server should not accept authentication information until encryption is established, so that the user and password are protected. I believe the FileZilla client will allow for command line passing of the user and password .. see the documentation here. Given the reputation of the FileZilla project, I would expect it to operate securely. |
|||
|
|
|
As others have mentioned, a command-line password should be the last resort. However, if nothing else is possible; one can go for ssh pass
|
|||
|
|