Showing posts with label ftp. Show all posts
Showing posts with label ftp. Show all posts

Tuesday, March 06, 2007

Connecting to servers in Ubuntu with "Connect to Server..."

I don't know how this has eluded me for so long, but there is actually a very nice interface built into Ubuntu that allows you to connect to servers using any of the following protocols: ftp, ssh, windows share, WebDAV (http), Secure WebDAV (https), and more. This is a nice alternative to using third party software like FireFTP (even though that program rocks) or the command line.

Simply pulling down the Places->Connect to Server... option in GNOME opens a dialog box which allows you to enter the appropriate information about the server you want to connect to. After the connection is successful, a folder representing the remote file system will appear on both the Desktop and in the Places menu. Another nice feature is that the folder even has some little letters on it telling you what protocol it is connecting over. You can now drag and drop files via the Nautilus interface, as if the directory was local. How convenient!

This tip found via the free online book Ubuntu Linux Bible. (Reviews on Amazon) By the way, this is an incredibly comprehensive reference on all things that an end user might want to do on Ubuntu. It also has sections on setting up subversion, using LaTeX, setting up other servers such as Apache, multimedia usage, and just about everything else. UPDATE: Whoops! This actually got posted by mistake by Lifehacker... the book has been taken down... it's still a good book, though!

UPDATE: For some more (unrelated) GNOME fun, right click on an icon and select "Stretch Icon" to blow up the icon to a cartoonish size. Click "Restore Icon's Original Size" in the same menu if you get tired of it (which you will, after 2 seconds).

Sunday, August 06, 2006

Server Building, Part 4 (vsftpd configuration)

Here is some information on configuring vsftpd 2.0.3 on Ubuntu 5.10 (Breezy Badger):

The settings for this program are in /etc/vsftpd.conf There is a short manpage for vsftpd ("man vsftpd" is the command) but the manpage for the file ("man vsftpd.conf") gives a more exhaustive description of options that vsftpd offers. Options are set in option=value form in the config file (example: "anonymous_enable=YES"). Most settings are not enabled if they are not found in the config file but there is some default behavior if some settings are not found. Check the manpage and FAQ for details. I'm mostly concerned with setting up access so that only I can get access to this machine. There are a few types of users in the FTP server paradigm: local users (that have an account on the machine), anonymous users (just anyone on the net) and root. Here are some simple options to set to achieve what I want to do:

Anonymous users:
  • anonymous_enable -- allows anonymous login, on by default
  • anon_upload_enable -- allows anonymous users to upload files... keep this off unless you want a lot of porn on your server (so they say)
  • anon_mkdir_write_enable -- allows anonymous users to use any form of the ftp write command
  • no_anon_password -- allow anonymous users to login without a password... probably a good idea to enable this, since the password is just "anonymous" otherwise

Local users:
  • local_enable -- allows local users to log in... I enable this so I can log in as myself
  • chroot_local_user -- restrict local users to their home directories (apparently a security risk... read the vsftpd FAQ for details)
  • chroot_list_enable -- enables a list of users that can use the chroot() command
  • chroot_list_file -- the location of the file that specifies the users that can use the chroot() command... with my settings, the users listed in this file have full access to the system whereas the users not listed are restricted to their home directories

Other:
  • ftpd_banner -- the message users see when they login
  • write_enable -- enable any form of FTP write (allow users to put stuff on server)

To restart vsftpd with an edited config file (that is, to see the changes you just made to the file put into effect) use this command: /etc/init.d/vsftpd restart

Wednesday, July 12, 2006

Server Building, Part 3 (FTP servers, commands)

Onto the software... there are a variety of FTP deamons to choose from, but these two seem to be the most highly regarded ones:
I chose vsftpd because I saw several message board threads which claimed that it was very easy to configure and incredibly secure.

Some other general FTP sites, for those interested:
I installed vsftpd with a simple "sudo apt-get install vsftpd" (thanks again, Ubuntu!). Two of the major issues one faces when setting up an FTP deamon (which basically allows certain people access to the server's file system depending on who they are and what the admin wants them to see) are what local users (users that have an account on the computer) can do and what anonymous users (strangers) can do. Variables in the etc/vsftpd.conf file that have "local" or "anonymous" or "anon" in them pretain to these issues. Use the command "man vsftpd.conf" to find out more about what commands you can put in the conf file. If you are configuring vsftpd, the faq page, in addition to the manpage, will be your best friend:
ftp://vsftpd.beasts.org/users/cevans/untar/vsftpd-1.2.2/FAQ

Here are some helpful admin commands to help set up the FTP server:
  • ifconfig display helpful TCP/IP information (including your IP address)
  • ping confirm a remote host is online and responding; I usually use "ping -c 4 www.google.com" to see if I'm connected on a certain computer
  • netstat info about network connections, routing tables, interface stats, masquerade connections and multicast memberships
  • host a DNS lookup utility
  • ip show/manipulate routing, devices, policy routing and tunnels
  • dig another DNS lookup utility
Here are some commands to query an ftp server:
  • ftp start the ftp prompt
  • bye close the ftp prompt
  • open open a connection with a remote host
  • close close the connection
  • get download a file from the server
  • put store a file on the server
  • Other commands to navigate on the server are similar to those that you use to move aroud regularly: ls, pwd, etc.
  • To do something on your local machine from the ftp prompt, prefix the command with an exclamation mark !
UPDATE: Some more helpful stuff, found via Ubuntu Linux Bible.
  • ? display all the commands the FTP server supports
  • bin enable binary mode, for transferring all binary files... most times this will get done automatically, but you don't want to have your music files corrupted when you transfer them in ASCII mode, do you?
  • hash print a hash (#) for every kilobyte transferred... good if you want to know if the server is transferring data or just hanging when there's no output
The good news is that the server is working. The bad news is that it is not accessible behind my building's firewall. I went to see the basement where all the wires go, but I don't think people would be to happy if I started unplugging stuff to test how the system worked. I'll ask the admin for more details when he gets off his vacation...