Search Results for: ftp

3 ways to automate file transfers using ftp

Introduction In some of our earlier articles we’ve explained the setting up of chrooted sftp and chrooted ssh accounts along with the setup of an ftp server using vsftpd. In today’s automation driven enterprise infrastructure environments we may often find ourselves in situations where we need to automate the transfer of files using the ftp/sftp protocol. Setting up passwordless tranfer of files using sftp is farily stragithforward.  Since sftp is based on the ssh protocol we can generate and use ssh keys to setup passwordless authentication to allow for automated file tranfers. In this article we will demonstrate three techniques using which you can automate the transfer of files using FTP protocol as well. Method 1: Using wget The wget command provides options to connect to the ftp server and download a file while specifying the credentials on the command line. In the below example, we connect to the ftp server with IP address using the user name sahil and password as L#giN@123 and download the file download.txt. [root@sahilsuri0081 ~]# wget --user=sahil --password='L#giN@123' --2018-07-27 17:39:40-- => ‘download.txt’ Connecting to connected. Logging in as sahil ... Logged in! ==> SYST ... done. ==> PWD ... done. ==> TYPE I ... done. ==> CWD not needed. ==> SIZE download.txt ... done. ==> PASV ... done. ==> RETR download.txt ... done. [ <=> ] 0 --.-K/s in 0s...

Read More

Disable Delete Permission For Specific User using vSFTPd server

Introduction Data security and data integrity are critical for the successful functioning of any enterprise infrastructure. Setting up file servers to transfer files via FTP & SFTP is common practice. Some files being transferred and shared using FTP servers could have very important information like customer and billing data. Accidental deletion of such files could cause a major problem for the system administrator. If the passwords for the accounts being used to access these files get leaked and someone purposefully deletes the files then this could also cause a major issue. In one of our previous articles, we demonstrated how to configure chrooted sftp user accounts wherein the user was not permitted to access any folder outside the realm of it’s own home directory. This is a secure setup and is frequently implemented in organizations across the globe. In this article, we’ll shift our focus back to ftp and show you step by step how you could prevent specific users from deleting any files they might have access to. Step 1: Add the test user For the purpose of this demonstration we’ll be working on a Centos 6.8 system and will use a user account named nixuser to test our setup. So, first we’ll add this user. [root@linuxnix ~]# useradd -s /bin/false nixuser [root@linuxnix ~]# passwd nixuser Changing password for user nixuser. New password: BAD PASSWORD: it is WAY...

Read More

Enabling passwordless authentication for chrooted sftp users in Linux

Introduction In one of our previous articles we demonstrated how to setup chrooted sftp accounts. You may have certain application users which need to connect to the sftp server to transfer files in an automated manner without manual intervention. An enterprise infrastructure may comprise of many scripts as well which might need to transfer files to the sftp server in an automated fashion without having the need to enter credentials. Configuration of password less authentication for chrooted sftp user accounts is similar to that of ssh user accounts but involves an additional step. In this article we will demonstrate how to setup passwordless authentication for a chrooted sftp user account. In order to make this post easy to follow for our readers and maintain continuity we will setup passwordless sftp authentication for the chrooted sftp user named sahil which we created in our earlier article where we explained the setting up of chrooted sftp users. Step 1: Ensure destination user credentials are working Before we setup passwordless authentication let’s first try to login to the server as the user sahil with it’s password to make sure that the user account is working and has been setup correctly. [root@linuxnix ~]# sftp sahil@linuxnix Connecting to linuxnix... sahil@linuxnix's password: sftp> ls sftp> pwd Remote working directory: /myhome sftp> quit [root@linuxnix ~]# Step 2: Setup ssh keys for the source user For the purpose...

Read More

Over 16,000 readers, Get fresh content from “The Linux juggernaut”

Email Subscribe


My photo
My name is Surendra Kumar Anne. I hail from Vijayawada which is cultural capital of south Indian state of Andhra Pradesh. I am a Linux evangelist who believes in Hard work, A down to earth person, Likes to share knowledge with others, Loves dogs, Likes photography. At present I work at Bank of America as Sr. Analyst Systems and Administration. You can contact me at surendra (@) linuxnix dot com.