0% found this document useful (0 votes)
70 views

Network File System (NFS) : Installation

NFS allows files to be shared over a network, appearing as local files. Key benefits are centralized storage and home directories accessible everywhere on the network. To set up NFS, install the server, export shared directories in /etc/exports, start the server, and mount the shares on clients. Samba provides similar file sharing between Linux and Windows via SMB/CIFS. It can automatically share users' home directories. FTP allows uploading and downloading files via anonymous or authenticated access controlled by user permissions. The vsftpd server is easy to configure for these access methods.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views

Network File System (NFS) : Installation

NFS allows files to be shared over a network, appearing as local files. Key benefits are centralized storage and home directories accessible everywhere on the network. To set up NFS, install the server, export shared directories in /etc/exports, start the server, and mount the shares on clients. Samba provides similar file sharing between Linux and Windows via SMB/CIFS. It can automatically share users' home directories. FTP allows uploading and downloading files via anonymous or authenticated access controlled by user permissions. The vsftpd server is easy to configure for these access methods.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Network File System (NFS)

NFS allows a system to share directories and files with others over a network. By using NFS, users and programs can access files on remote systems almost as if they were local files. Some of the most notable benefits that NFS can provide are: Local workstations use less disk space because commonly used data can be stored on a single machine and still remain accessible to others over the network. There is no need for users to have separate home directories on every network machine. Home directories could be set up on the NFS server and made available throughout the network. Storage devices such as floppy disks, CDROM drives, and USB Thumb drives can be used by other machines on the network. This may reduce the number of removable media drives throughout the network.

Installation
At a terminal prompt enter the following command to install the NFS Server:
sudo apt-get install nfs-kernel-server

Configuration
You can configure the directories to be exported by adding them to the /etc/exports file. For example:
/home *(rw,sync,no_root_squash)

You can replace * with one of the hostname formats. Make the hostname declaration as specific as possible so unwanted systems cannot access the NFS mount. To start the NFS server, you can run the following command at a terminal prompt:
sudo /etc/init.d/nfs-kernel-server start

NFS Client Configuration


Use the mount command to mount a shared NFS directory from another machine, by typing a command line similar to the following at a terminal prompt:
sudo mount example.hostname.com:/ubuntu /local/ubuntu

Warning The mount point directory /local/ubuntu must exist. There should be no files or subdirectories in the /local/ubuntu directory. An alternate way to mount an NFS share from another machine is to add a line to the /etc/fstab file. The line must state the hostname of the NFS server, the directory on the server being exported, and the directory on the local machine where the NFS share is to be mounted.

The general syntax for the line in /etc/fstab file is as follows:


example.hostname.com:/ubuntu /local/ubuntu nfs rsize=8192,wsize=8192,timeo=14,intr

If you have trouble mounting an NFS share, make sure the nfs-common package is installed on your client. To install nfs-common enter the following command at the terminal prompt:
sudo apt-get install nfs-common

Install Samba Server


If you want to share files between your Linux and Windows computers, your best option is to use Samba file sharing. To install, first open a terminal window and enter the following command: sudo apt-get install samba smbfs Weve got samba installed, but now well need to configure it to make it accessible. Run the following command to open the configuration file, substituting your editor of choice: sudo gedit /etc/samba/smb.conf Find this section in the file: ####### Authentication ####### # security = user is always a good idea. This will require a Unix account # in this server for every user accessing the server. See # /usr/share/doc/samba-doc/htmldocs/Samba-HOWTO-Collection/ServerType.html # in the samba-doc package for details. ; security = user Uncomment the security line, and add another line to make it look like this: security = user username map = /etc/samba/smbusers This will set Samba to use the smbusers file for looking up the user list.

Create a Samba User There are two steps to creating a user. First well run the smbpasswd utility to create a samba password for the user. sudo smbpasswd -a <username> Next, well add that username to the smbusers file. sudo gedit /etc/samba/smbusers Add in the following line, substituting the username with the one you want to give access to. The format is <ubuntuusername>= <samba username>. You can use a different samba user name to map to an ubuntu account, but thats not really necessary right now. <username> = <username> Now you can create samba shares and give access to the users that you listed here.

Share Linux Home Directories using Samba


Samba Server allows you to share the home directories of users automatically. This can be useful so that you dont have to manually create every share for every user. To share the home directories, open up smb.conf with the following command: sudo gedit /etc/samba/smb.conf Find this section of the file, and make it match the following: #======================= Share Definitions ======================= # Un-comment the following (and tweak the other settings below to suit) # to enable the default home directory shares. This will share each # users home directory as \\server\username [homes] comment = Home Directories browseable = yes # By default, \\server\username shares can be connected to by anyone # with access to the samba server. Un-comment the following parameter # to make sure that only username can connect to \\server\username valid users = %S # By default, the home directories are exported read-only. Change next # parameter to yes if you want to be able to write to them. writable = yes Now you should be able to map a drive on windows using the following share format: \\ubuntumachine\username

For example, if the Ubuntu machine is named ubuntuserv, and the username is geek, your share path would be \\ubuntuserv\geek

FTP Server
File Transfer Protocol (FTP) is a TCP protocol for uploading and downloading files between computers. FTP works on a client/server model. The server component is called an FTP daemon. It continuously listens for FTP requests from remote clients. When a request is received, it manages the login and sets up the connection. For the duration of the session it executes any of commands sent by the FTP client. Access to an FTP server can be managed in two ways: Anonymous Authenticated In the Anonymous mode, remote clients can access the FTP server by using the default user account called "anonymous" or "ftp" and sending an email address as the password. In the Authenticated mode a user must have an account and a password. User access to the FTP server directories and files is dependent on the permissions defined for the account used at login. As a general rule, the FTP daemon will hide the root directory of the FTP server and change it to the FTP Home directory. This hides the rest of the file system from remote sessions.

vsftpd - FTP Server Installation


vsftpd is an FTP daemon available in Ubuntu. It is easy to install, set up, and maintain. To install vsftpd you can run the following command:
sudo apt-get install vsftpd

Anonymous FTP Configuration


By default vsftpd is configured to only allow anonymous download. During installation a ftp user is created with a home directory of /home/ftp. This is the default FTP directory. If you wish to change this location, to /srv/ftp for example, simply create a directory in another location and change the ftp user's home directory:
sudo mkdir /srv/ftp sudo usermod -d /srv/ftp ftp

After making the change restart vsftpd:


sudo /etc/init.d/vsftpd restart

Finally, copy any files and directories you would like to make available through anonymous FTP to /srv/ftp.

User Authenticated FTP Configuration


To configure vsftpd to authenticate system users and allow them to upload files edit /etc/vsftpd.conf:
local_enable=YES write_enable=YES

Now restart vsftpd:


sudo /etc/init.d/vsftpd restart

Now when system users login to FTP they will start in their home directories where they can download, upload, create directories, etc. Similarly, by default, the anonymous users are not allowed to upload files to FTP server. To change this setting, you should uncomment the following line, and restart vsftpd:
anon_upload_enable=YES

You might also like