Author Archives: cviorel - Page 12

HOWTO: Create a FTP server with user access (proftpd)

A. The GUI way (for beginners only)

For those who are new to linux and don’t want to use a FTP server without GUI, or just for those who don’t use often their FTP server and wish to set it
quickly without a high level of security, there is a GTK GUI for proftpd.
Be careful, it’s less secure than configuring yourself your server.

1. Install proftpd and gproftpd with synaptic or with this command:
Code:

2. Play with the GUI and set up quickly your server.

Feel free to post here if you have some problems with gproftpd but it shouldn’t be too hard to use (it took me 2 minutes to set up a small FTP server ).

B. The secure way

1. Install proftpd with synaptic or with this command:
Code:

2. Add this line in /etc/shells file (sudo gedit /etc/shells to open the file):
Code:

Create a /home/ftp directory:
Code:

Create a user named ftp_user which will be used only for ftp access. This user don’t need a valid shell (more secure) therefore select /bin/false shell
for ftp_user and /home/ftp as home directory (property button in user and group window).
To make this section clearer, i give you the equivalent command line to create the user, but it would be better to use the GUI (System -> Administration -> User -> Group) to create the user since users here often got problems with the user creation and the password (530 error) with the command line, so i really advice to use the GUI :
Code:

In ftp directory create a download and an upload directory:
Code:

Now we have to set the good permissions for these directories:
Code:

3. OK, now go to the proftpd configuration file:
Code:

and edit your proftpd.conf file like that if it fit to your need:

Code:

Ok you have done proftpd configuration. Your server is on port 1980 (in this exemple) and the access parameters are
user: ftp_user
password: the one you’ve set for ftp_user

4. To start/stop/restart your server:
Code:

To perform a syntax check of your proftpd.conf file:
Code:

To know who is connected on your server in realtime use “ftptop” command (use “t” caracter to swich to rate display), you can also use the “ftpwho”
command.

Prevent X.Org from Starting in Ubuntu

Prevent X.Org from Starting in Ubuntu

If you’ve got an Ubuntu machine that you initially installed with Ubuntu Desktop, but would like to run as a server, you can just disable the graphical
environment from starting up in order to save resources. This is also useful for doing system maintenance from the command line that needs to be performed
outside of the GUI.

The only reason to do this instead of removing the packages would be because you might want to still sometimes use the box through the GUI.

Disable X.Org

In order to disable the graphical environment, we’ll need to disable GDM, the Gnome Display Manager. In order to do this, you’ll need to run the following
command at the terminal:

sudo update-rc.d -f gdm remove

When you restart your computer, you’ll be presented with a text-mode login prompt instead of the graphical environment.

Run X.Org While Disabled

If you want to run the graphical environment, all you have to do is type the following command from the prompt, making sure to run it as your normal user
account.

startx

The annoying gray screen will go away once Gnome is fully started.

Enable X.Org

If you want to re-enable X11 it’s a simple matter of running this command from the terminal:

sudo update-rc.d -f gdm defaults

When you restart, you’ll be presented with the graphical prompt again.

Enable cupsys Web Admin Interface

Enabling cupsys Web Admin Interface

If you are trying to get your printing system going, and search for tips and docs on the web, you will find most of the documentation referring to http://localhost:631 as your cupsys administration interface. However, on Ubuntu, this browser-based administrative interface for cupsys is disabled by
default. Here’s how to enable it:
Select “System”->”Administration”->”Users and Groups” from the main menu on your desktop.
Select “Show all users” and/or “Show all groups”.
Add the user “cupsys” to the group “shadow” in the “groups” tab.

Restart cupsys by issuing the command:
sudo /etc/init.d/cupsys restart
IMPORTANT: I don’t know why the web admin interface was disabled in the first place – so please know that it is best to reverse all that you did once by
removing the user cupsys from the shadow group, and restarting cupsys, once your work with the interface is done.

If you want, from command line only:

sudo adduser cupsys shadow
sudo passwd cupsys
sudo /etc/init.d/cupsys restart

Adding a startup script to be run at bootup

So you have a script of your own that you want to run at bootup, each time
you boot up. This will tell you how to do that.
Write a script. put it in the /etc/init.d/ directory.
Lets say you called it FOO. You then run

You also have to make the file you created, FOO, executable, using

You can check out man update-rc.d for more information. It is a Debian
utility to install scripts. The option defaults puts a link to start FOO in
run levels 2, 3, 4 and 5. (and puts a link to stop FOO into 0, 1 and 6.)

Also, to know which runlevel you are in, use the runlevel command.

If you want to remove the script, just run: