Difference between revisions of "Create network shares"
| Line 18: | Line 18: | ||
'''$''' sudo rc-update add nfs default | '''$''' sudo rc-update add nfs default | ||
You should now be able to [[Mount network shares | mount]] the share from another machine on your network. | You should now be able to [[Mount network shares | mount]] the share from another machine on your network. | ||
| + | |||
| + | ---- | ||
In order to share files with machines on your network running Microsoft Windows, you'll need to install and configure a Samba server. Before performing the emerge, be sure to check that you have the desired USE flags set. | In order to share files with machines on your network running Microsoft Windows, you'll need to install and configure a Samba server. Before performing the emerge, be sure to check that you have the desired USE flags set. | ||
'''$''' sudo emerge -av samba | '''$''' sudo emerge -av samba | ||
| + | Once the emerge has completed, you will need to set up your shares. This is done by editing the file ''/etc/samba/smb.conf''. | ||
| + | '''$''' sudo nano -w /etc/samba/smb.conf | ||
| + | === /etc/samba/smb.conf === | ||
Revision as of 14:55, 26 December 2010
You may have the need to share files and folders on your Gentoo PC with other files on the network. There are two primary ways of doing this, and these methods are using nfs or samba. Samba is geared towards compatibility with Microsoft Windows, whereas nfs is an abbreviation for network file system, and has its roots in the early days of unix.
On order to create a samba or nfs share, you'll need to make sure you have the proper kernel config. The necessary options are shown in the kernel section.
To create an nfs share, you'll first need to emerge the net-fs/nfs-utils package. This is ideal if you are wanting to share files between multiple linux systems. If there is a windows machine in the mix (including virtual machines) you will probably want to use samba.
$ sudo emerge -av nfs-utils
Once the package has been emerged, we can configure the exports, which are the folders we're sharing and the access level and permissions for clients. In the example below, we will share the folder /home/gr0x0rd to some other machines on the network.
$ sudo nano -w /etc/exports
/etc/exports
# /etc/exports: NFS file systems being exported. See exports(5). /home/gr0x0rd 192.168.0.100(rw,no_subtree_check) /home/gr0x0rd 10.10.3.119(rw,no_subtree_check)
Once you have saved your exports file, we can start the nfs server.
$ sudo /etc/init.d/nfs start
To start the nfs server with the system,
$ sudo rc-update add nfs default
You should now be able to mount the share from another machine on your network.
In order to share files with machines on your network running Microsoft Windows, you'll need to install and configure a Samba server. Before performing the emerge, be sure to check that you have the desired USE flags set.
$ sudo emerge -av samba
Once the emerge has completed, you will need to set up your shares. This is done by editing the file /etc/samba/smb.conf.
$ sudo nano -w /etc/samba/smb.conf