In this article I'll explain how to set up a simple file share on your Crunchbang computer. We'll use Samba which is the most popular file sharing software for Linux. The commands used here can be used in other Linux operating systems too. I will not go into detail and will explain only the basic steps to get simple file sharing working.
At the end, from your Windows computer you'll be able to browse to and save/open files on your Crunchbang Linux computer.
To download and install Crunchbang please see my previous article:
Go to your Crunchbang Linux computer, start it and login as usual.
Right click on the desktop and click Terminal
At the $ prompt type:
sudo apt-get install samba libpam-smbpass [Enter]
Samba will download and install. It will ask you for the name of the network workgroup:
Unless you've changed it, accept the default "WORKGROUP".
Configure File Sharing
Change to the srv folder, type:
cd /srv [Enter]
Create a new folder called share:
sudo mkdir share [Enter]
This sets the permissions for the share folder to full read/write:
sudo chmod 777 share/ [Enter]
Make a backup copy of the original Samba configuration file, this is just in case you need it for future reference:
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.original [Enter]
Edit the Samba configuration file:
sudo geany /etc/samba/smb.conf [Enter]
The Geany text editor will open the smb.conf file. Replace all the content of the file with the following:
disable netbios = no
workgroup = workgroup
server string = fileserver
dns proxy = no
log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
pam password change = yes
map to guest = bad user
usershare allow guests = yes
security = user
username map = /etc/samba/smbusers
load printers = no
printing = bsd
printcap name = /dev/null
disable spoolss = yes
path = /srv/share
writeable = yes
browseable = yes
create mask = 6777
directory mask = 6777
- The "workgroup=" parameter is set to "workgroup", this is the default name of the Windows network you are connecting to. If your workgroup name is different, change it here.
- The "server string=" parameter can be anything. It should be something descriptive for this computer. If there are two Linux computers configured with the same "server string=" name, one of them will not appear when you look for it from your Windows computer. Therefore, make sure the "server string=" name is unique on your network.
Save and exit the text editor (Geany).
At the $ prompt enter the following to restart Samba:
sudo /etc/init.d/samba restart [Enter]
Wait for 30 seconds.
On the Windows computer
Go to your Windows computer, browse in Windows Explorer to your Network, browse under Microsoft Windows Network and Workgroup - you should see your Crunchbang computer appear in the list.
In the above example from a Windows XP computer you can see I've found my Crunchbang computer. In brackets you can see it says "Crunchbangt42" - this is the host name of my Crunchbang computer, yours will be different. you can find the host name on your Crunchbang desktop:
On your Windows computer, if you can't find the Crunchbang computer on the network, on the Windows Explorer address bar you can type \\ and the host name directly. In my case I would enter "\\crunchbangT42".
If you are using Windows 7 click Start and enter \\ and the name of the host in the search box. Click on it...
In Windows when you click the share folder you'll be prompted to login:
|This is a Windows XP connect box but you will see something |
similar for Windows 7 or any other version of Windows.
Enter your Crunchbang username, password and click OK. If you want this Windows computer not to prompt you for a password next time, click the [ ] Remember my password box.
The above is the result. You can copy files to/from this location.
The following Youtube video shows in more depth how to set up Samba. My thanks to the author as it what I used as a starting point for this article.