ftp or sftp

Issues related to configuring your network
Post Reply
mahmood
Posts: 88
Joined: 2017/06/04 12:21:09

ftp or sftp

Post by mahmood » 2018/09/07 09:43:50

It seems that ftp command is not available in centos7. Instead I see sftp.
Is that all? Is there any way to use ftp command? The program I use, only supports ftp command.

User avatar
TrevorH
Forum Moderator
Posts: 24118
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: ftp or sftp

Post by TrevorH » 2018/09/07 09:54:02

You would need to install it. Learn how to use yum by reading man yum and then check the output from e.g. yum provides '*/bin/ftp' which should tell you which package(s) provide that file then install the right one.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

mahmood
Posts: 88
Joined: 2017/06/04 12:21:09

Re: ftp or sftp

Post by mahmood » 2018/09/07 11:55:57

OK I now have these packages

Code: Select all

Installed Packages
ftp.x86_64                                                0.17-67.el7                          @base
vsftpd.x86_64                                             3.0.2-22.el7                         @base
Also I changes the pam service to ftp instead of vsftpd. However as you can see below, I can use sftp but ftp command doesn't work

Code: Select all

# systemctl list-unit-files | grep ftp
vsftpd.service                                enabled
vsftpd@.service                               disabled
vsftpd.target                                 disabled
# grep -r pam_service /etc/vsftpd/vsftpd.conf
pam_service_name=ftp
# systemctl restart vsftpd
# sftp snadmin@localhost
snadmin@localhost's password:
Connected to localhost.
sftp> quit
# ftp snadmin@localhost
ftp: snadmin@localhost: Name or service not known
ftp>
May I know why?

lightman47
Posts: 772
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: ftp or sftp

Post by lightman47 » 2018/09/07 12:28:06

vsftp is an ftp SERVER - for setting up your own ftp site. Chances are it isn't what you wanted, but no harm done.

Incidentally, I use filezilla for my ftp chores. It just another option with a GUI.
"There's NO detailed answer to a question lacking details."

mahmood
Posts: 88
Joined: 2017/06/04 12:21:09

Re: ftp or sftp

Post by mahmood » 2018/09/07 13:46:28

Well I am Using Oxwall which has a feature to upload plugins via ftp. I want to know why I can run sftp command but not ftp?

User avatar
TrevorH
Forum Moderator
Posts: 24118
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: ftp or sftp

Post by TrevorH » 2018/09/07 14:12:56

Because they are completely different things. The sftp client talks to the ssh daemon via tcp port 22 and all traffic is encrypted. It's a totally different protocol to ftp.

You did install the ftp package which does contain the ftp client but you need to use it properly. It wants a hostname or an ip address given to it and does not understand the user@host format so you need to ftp some.host.name and then once it talks to you then you can specify your username and password.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

mahmood
Posts: 88
Joined: 2017/06/04 12:21:09

Re: ftp or sftp

Post by mahmood » 2018/09/07 14:23:59

It seems that I totally confused ftp and sftp. All I see on the web regarding ftp are how to configure centos with vsftp.

I am not able to login with a user name

Code: Select all

# ftp localhost
Trying ::1...
Connected to localhost (::1).
220 (vsFTPd 3.0.2)
Name (localhost:root): snadmin
331 Please specify the password.
Password:
530 Login incorrect.
Login failed.
ftp> 
However, I have configures a vsftp.userlist and the sftp command works. I wonder where else have to define snadmin for ftp service?

mahmood
Posts: 88
Joined: 2017/06/04 12:21:09

Re: ftp or sftp

Post by mahmood » 2018/09/07 16:51:31

OK. I wrongly changed pam_service_name to ftp. The correct is vsftpd
Then I was able to login

Code: Select all

# ftp localhost
Trying ::1...
Connected to localhost (::1).
220 (vsFTPd 3.0.2)
Name (localhost:root): snadmin
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> quit
221 Goodbye.

User avatar
TrevorH
Forum Moderator
Posts: 24118
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: ftp or sftp

Post by TrevorH » 2018/09/07 17:05:23

In general, if at all possible, ftp is to be avoided as it does all its traffic in plain text including usernames and passwords. It's also a pig to firewall properly as it uses one port for commands and then random ports to send data. Since sftp uses ssh as its transport, none of those apply.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply