how to hide ftp connection info - file

in windows operating systems we can use ftp commands in file as parameters to ftp.exe as following:
ftp -s:filename
The parameters filename can contain password, username .... and other obvious commands.
is there alternative way or any other ftp tool can accept encrypted parameter file.(at least encrypted for username and password) to hide connection info from clients.
now I am going to generate temp parameter filename (plain text) in code,
then execute ftp -s:filename
finally delete the filename.
however is there any tool could accept encrypted connection presetting file?

Related

Automatic FTP batch file to send encryption keys in one file [duplicate]

This question already has an answer here:
How can I use bat file to achieve ftp function without txt file? or the password can be encrypted in txt file?
(1 answer)
Closed 11 months ago.
I am unable to find a way to have a batch file login to a FTP server without a different file being needed. The script is being run remotely on customer computers through Atera so we can grab customer bitlocker encryption keys then send a file that was created from the same script containing the keys. I would love some help for this on how to automatically login with the FTP username and password.
:: #echo off
set CUR_YYYY=%date:~10,4%
set CUR_MM=%date:~4,2%
set CUR_DD=%date:~7,2%
set SUBFILENAME=%CUR_YYYY%%CUR_MM%%CUR_DD%-%CUR_HH%%CUR_NN%%CUR_SS%
::Might move the computer name into variable SUBFILENAME
echo
cd..
cd..
manage-bde -protectors c: -get > c:\BLK\BLK_%computername%_%SUBFILENAME%.txt
My computer has PURE-FTPd for the client.
If I were to manually use the FTP to send a file the command prompt would look like this but will not work in the batch file due to it not reading the username and password
C:\>ftp website.com
Connected to website.com.
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 2 of 500 allowed.
220-Local time is now 13:59. Server port: 00.
220-This is a private system - No anonymous login
220 You will be disconnected after 15 minutes of inactivity.
504 Unknown command
User (website.com:(none)): USERNAME
331 User person#website.com OK. Password required
Password:PASSWORD
230-Your bandwidth usage is restricted
230 OK. Current restricted directory is /
ftp> cd Test
250 OK. Current directory is /Test
ftp> put C:\BLK\Ethan.txt
200 PORT command successful
150 Connecting to port 60060
226 File successfully transferred
The password is hidden while typing it
The standard FTP command-line client with Windows requires a response file (option -s:file) to work properly in batch mode. Otherwise, it works in interactive mode, and you'll need a separate process to pilot it through its stdin/stdout if you want an automatic operation.
Otherwise, you can use psftp, shipped with PuTTY.

Automate connection to SFTP server (FileZilla)

I would like to automate the connection to an SFTP server (FileZilla) in order to create a batch file to automate some reporting processes.
What I used until now is the following script:
sftp alessandro:arica.123#85.148.385.22
Theoretically, I am passing in the script above the username (alessandro), the password (arica) and the hostname. The problem is that the password is not passed as a parameter, therefore in order to connect, I am asked to enter the password in the terminal.
Can you explain me and tell me what I am doing wrong?
Can you explain me and tell me what I am doing wrong?
The manual page for sftp explain synopsis of sftp command this way (abbreviated):
sftp [...] [user#]host
As you can see, there is no :password so both of username:password are passed as a username to the server. sftp command does NOT accept passwords on command-line, because it is very bad security practice to store the passwords in plain text in scripts.
You should configure your server to accept public key authentication (it is not so hard and very useful for automation!):
ssh-keygen -t rsa -f ~/.ssh/id_rsa
ssh-copy-id alessandro#85.148.385.22 # write password once
ssh alessandro#85.148.385.22 # will not ask for password again

Transferring files with SFTP

So I'm trying to transfer files to a remote computer on an SSH system. 'I've used the sftp command, used lls to confirm the presence of the file in the local computer, and then implemented the put filename command. However, I receive the same result each time:
stat filename: No such file or directory
I just don't know what's going wrong! Any help or troubleshooting tips would be appreciated.
If you're currently using Windows you can download winscp and use that to transfer files. It has a nice graphic interface that is easy to interact with
Well, supposing that you are on a Linux/Unix environment, you could use scp. Typically, the syntax for an scp command would be like this:
$ scp foobar.txt your_username#remotehost.net:/some/remote/directory
The above command copies the file foobar.txt which resides in the local computer, to a specific directory in the remote machine, using a username (you will be asked for a password later).
The sftp command line client uses the ssh transport and will tunnel your connections using your key. So if you have ssh access, you should also have sftp access. This is a secure option for people who are more comfortable with ftp. Most GUI ftp clients should also support sftp.
I was facing also in this issue when trying to upload files from the local to the remote server. I did commands well and clean but the mistake I was making was that: I've logged into the remote server with ssh and then login with sftp. In that way, sftp will consider that your remote server is the local (as I logged in first to this via ssh) when using the command below:
put /c/path/to/file.txt
So, the thing to do is to login directly to the server via sftp and putting your local files in there.

Need Help to open ftp server and login with batch

I need to make a batch file which opens my ftp server automatically,How do i automatically input user name and password to the ftp username and password prompt.I have tried to use
echo username|ftp ipadress,but it is taking the input for both user name and password. So I need help to create a batch file, which automatically logins as "user" and password "pass"
Before you use the following script, please remember that the FTP protocol
doesn't allow encryptions, the authentication process and the data transitions.
Create a new text file with the following text:
open "myservername/serverip"
"%username%"
"password"
cd /upload
bin
hash
put/get "filename.cab"
bye
Note: Please choose the correct ftp commands to allow the script to work.
Save the file as runftp.txt (For example).
Run the command: c:\windows\system32\ftp.exe -s:runftp.txt
SOURCE: http://support.microsoft.com/kb/555976

How to copy file to remote server in Lotusscript

I want to create a Lotus Notes agent that will run on the server to generate a text file. Once the file is created, I need to send it to a remote server.
What is the best/easiest way to send the file to a remote server?
Thanks
If your "remote" server is on a local windows network, you can simply copy the file from the server file system to a UNC path (\myserver\folder\file.txt) using the FileCopy statement. If not, you may want to look at using a Java agent, which would make more file transfer protocols easily accessible.
In either case, be sure to understand the security restrictions on Notes agents - for your agent to run on the server and create a file on the server's file system, the agent will need to be flagged with a runtime security level of 2 or 3, and signed by an appropriately authorized ID.
Sending or copying files using O/S like commands to a remote server require that destination servers be also mapped as drives on your source server. As Ed rightly said, security needs to allow you to save files down onto the server and then try and copy them.
You can generate the file locally on the server and then use FTP commands in a script to send the file. Or if you're a java guru, you can try using Java.FTP to send the file as well. I had some trouble with it, but it should be possible providing an FTP account is setup on the destination server. FTP related stuff by a well known notes guy can be found here and here
I have done it using a script, and it's clumsy but effective in simply pushing files around. Ideally, if the server at the other end is a Domino server as well, you could actually attach the file in an email and send it to a mailin account on the destination server. I have done that before, and it's great as you can just pass the whole problem of getting files off to the SMTP process.

Resources