I am trying to automate an application deployment as part of this I need to upload a file to a server. I have created a minimal user and configured chroot for the SFTP server but I can't work out how to upload a file non interactive.
At present I am doing scp myfile [email protected]:newBuilds/
I tried sftp [email protected] myfile
(newBuilds
is the chroot dir) but this didn't upload anything but it did connect.
The reason for favouring this aproach and NOT using scp
is that its a lot more difficult to restrict scp access (from the information I have learned).