LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-21-2022, 10:00 AM   #1
Nitin dhepe
LQ Newbie
 
Registered: Jan 2022
Posts: 5

Rep: Reputation: 0
Unhappy file transfer through ftp


Hello,

I am using centOS 7 two machines under VMWARE. Both the virtual machines are pinging each other. ( network is Ok.) I have installed ftp software on both machines using command "yum install ftp." I am logging in both machines as root
having super user rights. ( naturally ).
But when I try to use command
# ftp < IP address of other virtual machine>, it gets connected and i am asked the password of other machine. ( i.e. root password, since i am logging as a root). When i give password , the message i get is PERMISSION DENIED.

I must be doing some silly mistake. I am typing correct password of root account of the other machine. Then why i am not able to log in on other machine to use file transfer through ftp?? Pl. help.
 
Old 01-21-2022, 10:03 AM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,307
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
Welcome.

Which distro, including version, is the host on which you are running VMware? And what is your specific use-case for attempting to resurrect the retro computing protocol FTP?

If you are looking for anonymous downloads, then HTTP/HTTPS is usually the best way to go. Nginx or Apache2 can provide that. If you need login-based uploads and downloads, then SFTP is the way to go. OpenSSH-server can provide that.
 
Old 01-21-2022, 10:18 AM   #3
murphnj
LQ Newbie
 
Registered: Sep 2006
Posts: 28

Rep: Reputation: 1
Your main problem is that ftp is a client-server protocol. You need to load the ftp server on at least one if them to transfer files. CentOS provides vsftp for this. (yum install vsftpd)

Turbocapitalist is correct in that ftp is old, and insecure. But if these are only in your local network, and for training or some other purpose, you can set up the ftp server on one, and transfer files to/from the other server from that one.

For the record, you'll also have to modify your firewall rules, and enable root for vsftp (it's off by default for security) Or create a local user to use for ftp.

Last edited by murphnj; 01-21-2022 at 10:24 AM.
 
1 members found this post helpful.
Old 01-21-2022, 10:28 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by Nitin dhepe View Post
Hello,
I am using centOS 7 two machines under VMWARE. Both the virtual machines are pinging each other. ( network is Ok.) I have installed ftp software on both machines using command "yum install ftp." I am logging in both machines as root having super user rights. ( naturally ).
But when I try to use command
# ftp < IP address of other virtual machine>, it gets connected and i am asked the password of other machine. ( i.e. root password, since i am logging as a root). When i give password , the message i get is PERMISSION DENIED.

I must be doing some silly mistake. I am typing correct password of root account of the other machine. Then why i am not able to log in on other machine to use file transfer through ftp?? Pl. help.
Two 'silly mistakes' are obvious; bolded them both for emphasis.
  • FTP? In 2022?? Why? Either SSH (which gives you sftp and scp) both work much better, and are much safer, along with already being installed/configured on your system (most likely), or HTTP/HTTPS can be used.
  • Logging in as root?? 'Naturally'??? That is a HORRIBLE idea, for a host of reasons.
More than likely, root is disabled for security reasons...have you tried another user ID?
 
2 members found this post helpful.
Old 01-21-2022, 10:30 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Quote:
#
centOS 7

ftp < IP address of other virtual machine>, it gets connected and i am asked the password of other machine. ( i.e. root password, since i am logging as a root). When i give password , the message i get is PERMISSION DENIED.
That would mean a FTP server is running, however it depends on which one i.e vsftpd, ProFTPd etc. It is possible to secure FTP using SSL/TLS but sftp should installed and already configured. Regardless root login should be disabled.
 
1 members found this post helpful.
Old 01-21-2022, 02:26 PM   #6
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Another quick and easy way to transfer files (securely) is rsync, which uses the ssh protocol for security.

As has been mentioned using root is extremely dangerous for your purpose and it is likely that even if A) the firewall allows an ftp connection, and B) the ftp server is accepting connections, you will not be able to connect because by default the ftp server does not ever allow connections as root.

By default none of the other protocols for file transfer allow connections as root either for security reasons.

Please read up on what transfer protocols are in use currently and how to configure the tool of choice for your use case.
 
1 members found this post helpful.
Old 01-21-2022, 07:19 PM   #7
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,947

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
If you configure ssh, then you can use sftp as a secure ftp, with similar (identical?) commands.
 
1 members found this post helpful.
Old 01-21-2022, 08:26 PM   #8
rclark
Member
 
Registered: Jul 2008
Location: Montana USA
Distribution: KUbuntu, Fedora (KDE), PI OS
Posts: 480

Rep: Reputation: 179Reputation: 179
I would suggest you try it as a normal user. Of course the user has to exist on the other side. I would think the ftp server would block root. Using root is a bad idea anyway. Nothing wrong with ftp on a local network contrary to the nay-sayers. We used it a lot back when. That said, sftp is better of course and the commands are exactly the same. sftp in available in Raspberry PI land by default and I use it all the time when working at the command line to transfer files back and forth from my desktops to the headless RPIs.
 
2 members found this post helpful.
Old 01-22-2022, 06:38 AM   #9
Nitin dhepe
LQ Newbie
 
Registered: Jan 2022
Posts: 5

Original Poster
Rep: Reputation: 0
file transfer through ftp

Quote:
Originally Posted by rclark View Post
I would suggest you try it as a normal user. Of course the user has to exist on the other side. I would think the ftp server would block root. Using root is a bad idea anyway. Nothing wrong with ftp on a local network contrary to the nay-sayers. We used it a lot back when. That said, sftp is better of course and the commands are exactly the same. sftp in available in Raspberry PI land by default and I use it all the time when working at the command line to transfer files back and forth from my desktops to the headless RPIs.
Thanks a lot. I tried with different user as well. The problem was firewall was enabled by default which was preventing logging in.
After disabling temporarily, things worked.

Thanks for the suggestions. Nice to learn linux with friends like you.
 
Old 01-22-2022, 06:45 AM   #10
Nitin dhepe
LQ Newbie
 
Registered: Jan 2022
Posts: 5

Original Poster
Rep: Reputation: 0
file transfer with ftp

Quote:
Originally Posted by JeremyBoden View Post
If you configure ssh, then you can use sftp as a secure ftp, with similar (identical?) commands.

Thanks a lot. I will also try configuring ssh and use sftp. At present, disabling firewall temporarily and logging as normal user things worked.

Thanks again. I am learning linux and it is quite interesting.
 
Old 01-22-2022, 06:51 AM   #11
Nitin dhepe
LQ Newbie
 
Registered: Jan 2022
Posts: 5

Original Poster
Rep: Reputation: 0
file transfer with ftp

Quote:
Originally Posted by TB0ne View Post
Two 'silly mistakes' are obvious; bolded them both for emphasis.
  • FTP? In 2022?? Why? Either SSH (which gives you sftp and scp) both work much better, and are much safer, along with already being installed/configured on your system (most likely), or HTTP/HTTPS can be used.
  • Logging in as root?? 'Naturally'??? That is a HORRIBLE idea, for a host of reasons.
More than likely, root is disabled for security reasons...have you tried another user ID?


Yes. you are absolutely right. I tried with logging as a normal user also. The problem was solved by temporarily disabling firewall which is enabled by default by OS. Now i will also try using sftp and scp by configuring ssh. Nice to learn linux with the help of people like you.

Thanks again.
 
Old 01-22-2022, 12:33 PM   #12
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,307
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
Rsync was mentioned above and works over SSH by default these days. It and SFTP clients like sftp are the way to go for file transfer.

scp should be avoided.

There are plenty of SFTP clients. Not only are FileZilla and Cyberduck available, there are less obvious ones like Thunar, PCManFM, and Nautilus, common file managers.
 
Old 01-23-2022, 11:13 PM   #13
tshikose
Member
 
Registered: Apr 2010
Location: Kinshasa, Democratic Republic of Congo
Distribution: RHEL, Fedora, CentOS
Posts: 525

Rep: Reputation: 95
Quote:
Originally Posted by Nitin dhepe View Post
The problem was solved by temporarily disabling firewall which is enabled by default by OS.
Now that you have identified the firewall as being a blocking point, why do not you reactivate it and allow FTP traffic?
This should not be complicated to achieve.
Finally, surely firewall was enabled by default for good and valid reasons.
 
Old 01-24-2022, 02:26 AM   #14
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,307
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
Quote:
Originally Posted by tshikose View Post
Now that you have identified the firewall as being a blocking point, why do not you reactivate it and allow FTP traffic?
This should not be complicated to achieve.
Finally, surely firewall was enabled by default for good and valid reasons.
Yes, the firewall is there for a good reason, but no it will not be uncomplicated to get FTP to pass through it. Check out the sequence diagrams for passive versus active FTP. There are solutions involving FTP, but none are simple. The simple way, which is also the secure way, is to use SFTP as it operates over SSH and needs only port 22 open. Unless one has an interest for 1970s retro computing there are no reasons to experiment with FTP any more.

Last edited by Turbocapitalist; 01-24-2022 at 02:40 AM. Reason: corrected the link markup
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
File transfer through ftp jitu.smart87@gmail.com Linux - General 4 01-12-2012 08:49 AM
file transfer program in c using FTP client and FTP server renuaseri Linux - Newbie 2 01-29-2011 05:49 AM
file transfer from one ftp server to another ftp server divyashree Linux - Newbie 7 02-24-2010 02:48 AM
Systems are unable to use IPv6 during file transfer through FTP ahm_irf Linux - Security 2 06-03-2007 05:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration