LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 05-20-2016, 06:27 AM   #1
BrianLaP49
LQ Newbie
 
Registered: Nov 2015
Posts: 7

Rep: Reputation: Disabled
Post Tutorial or walk through to set up a person to be able to ftp into Mint server for website.


Hello I know enough just to be dangerious. I would appreciate a walk through or tutorial on setting Mint linux webserver so someone can ftp their web pages into the site. Particular needs are the user admin for ftp useage to upload to server, what firewall issues need to be allowed and initial site setup.
 
Old 05-20-2016, 08:08 AM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,289
Blog Entries: 3

Rep: Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718
FTP has been retired about 10 years ago with the advent of SFTP but there are still a lot of guides kicking around the net where it is mentioned, partially because it is so hard to set up and used to get a lot of attention. What you want instead, because it is far less insecure and much easier, is SFTP. To get SFTP, just install the package OpenSSH-server on the target machine and then any user can log in with SFTP. (There are further instructions if you want to prevent shell access or require keys instead of passwords. Turning off passwords and using keys instead is highly recommended.)

To connect to an SFTP server, you can use your file manager or a special client like FileZilla. Nautlius is the default file manager for Ubuntu or Linux Mint, if you are using that, and there you can press ctrl-L and enter the connection information:

Code:
sftp://someuser@server.example.com/
Or instead of ctrl-L you can go to the menu File->Connect To Server and use the same dialog. FileZilla is almost as easy, but I'd recommend the file manager like Nautilus, Thunar, PCManFM, and the others for starters.

Be sure that everyone has a serious password, or that you use keys, because the minute it is on the net it will be found and bots will be trying the door knobs. With SFTP you can keep them out. With FTP not so much.
 
Old 05-20-2016, 01:09 PM   #3
Ihatewindows522
Member
 
Registered: Oct 2014
Location: Fort Wayne
Distribution: Ubuntu 16.04 LTS
Posts: 616
Blog Entries: 2

Rep: Reputation: 166Reputation: 166
Quote:
Originally Posted by Turbocapitalist View Post
FTP has been retired about 10 years ago with the advent of SFTP but there are still a lot of guides kicking around the net where it is mentioned, partially because it is so hard to set up and used to get a lot of attention. What you want instead, because it is far less insecure and much easier, is SFTP. To get SFTP, just install the package OpenSSH-server on the target machine and then any user can log in with SFTP. (There are further instructions if you want to prevent shell access or require keys instead of passwords. Turning off passwords and using keys instead is highly recommended.)

To connect to an SFTP server, you can use your file manager or a special client like FileZilla. Nautlius is the default file manager for Ubuntu or Linux Mint, if you are using that, and there you can press ctrl-L and enter the connection information:

Code:
sftp://someuser@server.example.com/
Or instead of ctrl-L you can go to the menu File->Connect To Server and use the same dialog. FileZilla is almost as easy, but I'd recommend the file manager like Nautilus, Thunar, PCManFM, and the others for starters.

Be sure that everyone has a serious password, or that you use keys, because the minute it is on the net it will be found and bots will be trying the door knobs. With SFTP you can keep them out. With FTP not so much.
Yeah, I agree. SSH is extremely simple, flexible (can even replace VNC in places), and by definition, secure. I would highly reccommend using KeePass or something of that nature to generate and store strong passwords. Ideally your key should look something like this:
3570d8ef2545770e925f4dce414a05ebfd4d5427ce5572566c8c74fc65f19eaf
For all intents and purposes these days, that's uncrackable...especially considering after I think 5 failed attempts you get locked out for about a minute. Change that every month, and you're good. You never need to remember it.
I used SSH and SFTP at work, and it was so simple and worked so well I used it at home.
 
Old 06-01-2016, 02:36 AM   #4
BrianLaP49
LQ Newbie
 
Registered: Nov 2015
Posts: 7

Original Poster
Rep: Reputation: Disabled
I was hoping for a tutorial of some sort. Thanks all for your help.
 
Old 06-01-2016, 02:40 AM   #5
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,289
Blog Entries: 3

Rep: Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718
We can walk you through it. There are a lot of choices and the answers change depending on the choices, so the tutorial would quickly either become a fat book or else irrelevant to your needs.

The first step is to set up basic SFTP for your users. Then the next steps depend on whether you want to try to chroot the accounts and to where.
 
Old 06-01-2016, 02:51 AM   #6
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,289
Blog Entries: 3

Rep: Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718
As to the firewall, you need to allow port 22 in for SSH/SFTP, ports 80 and 443 in for HTTP and HTTPS, and ICMP Echo Request in for ping.

Which web server are you using, Apache2 or nginx? How many virtual hosts (web sites) do you want or have?
 
Old 06-01-2016, 03:05 AM   #7
BrianLaP49
LQ Newbie
 
Registered: Nov 2015
Posts: 7

Original Poster
Rep: Reputation: Disabled
One virtual host to use as a testing server on apache2.
 
Old 06-01-2016, 03:45 AM   #8
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,289
Blog Entries: 3

Rep: Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718Reputation: 3718
Ok. If you are on Linux Mint 17.3 Rosa, then you will have UFW which is a front-end for iptables:

Code:
sudo ufw status
sudo ufw allow ssh
sudo ufw allow http
sudo ufw allow https
sudo ufw enable
That will open up the ports you will need for web services. Note that you enable UFW after allowing SSH in to keep from getting locked out. (You can also work directly with iptables if you don't want UFW.)

If you don't have the package openssh-server yet, you'll need that for remote access:
Code:
sudo apt-get update;
sudo apt-get install openssh-server;
It's also a good idea to install "tmux" and use that if you are accessing via SSH a lot.

If you have Apache2 already installed, you'll need to decide if you will host more than one web site now or in the future. It's easier to move things now. If not, then the defaults will do. For reference, the default vhost (web site) has its Apache2 configuration file in /etc/apache2/sites-enabled/000-default.conf The relevant line there is DocumentRoot which points to /var/www/html and if you are only ever going to run a single site from that machine it can be left alone. Otherwise, it is better to change it.

Will you have more than one web site hosted on that machine now or in the near future? If not, then you can set the group permissions for /var/www/html to allow the webmasters to work there: https://www.linuxquestions.org/quest...e-users-37043/ If yes, then change the DocumentRoot to point to a directory named after your web site, e.g. /var/www/www.example.com/html, create the directory and then set the permissions.
 
Old 06-01-2016, 10:34 AM   #9
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by BrianLaP49 View Post
I was hoping for a tutorial of some sort. Thanks all for your help.
LinuxMint doesn't make a "webserver" edition.
There's Common Sense, Experience, and Best Practice.
ftp as a means to access stuff from the server is best served using the sFTP protocol.
The "ftp server" can be anything that has started and configured an ftpd deamon.
"ftp server" software is not even entirely necessarily since you only need scp or sftp
and openssh-server provides this.

You have a host, it can be only a couple of things.

Local or Remote?
Physical or Virtual?

You're running an unknown OS incorrectly identified as "Mint linux webserver", Great!
I haz a toaster.
open a terminal and issue:
Code:
inxi -c0 -Fsz | nc termbin.com 9999
(Internet is assumed working)
and paste the short url here.

Thank you.

If that fails, in Terminal issue:
Code:
inxi -S
and paste the result here.

Thank you.

Last edited by Habitual; 06-01-2016 at 10:40 AM.
 
  


Reply

Tags
tutorial, web hosting


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
IS there any tutorial to host a website in a linux server just with few steps taylorgibbs81 Linux - Software 5 07-18-2012 05:16 PM
Set file links on website via ftp or php? dogpatch Linux - Networking 4 04-10-2011 01:47 PM
How do I set my FTP server to accept passive FTP? imsam Linux - Newbie 3 12-12-2004 06:22 AM
Walk Through Install.....This website! Quivver Slackware - Installation 4 02-20-2004 08:02 AM
I want to set up a Website and chroot the users ftp davidsch Linux - Newbie 2 11-10-2003 11:59 AM

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

All times are GMT -5. The time now is 06:27 PM.

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