Install Samba on your HTPC and access files via Windows
In order to access your file via Windows computers in your home network, you need a small software called Samba. It will install itself as a remote server and grant the access to some folder of your HTPC.
If you have XBMCBuntu instead of Ubuntu, you already will have Samba pre-installed. You might want to change some of the configuration, but straight out of the box it all works nicely!
You will see how to:
- Install and setup samba;
- Access your files via network;
- Create permanent credentials to avoid password prompts;
- Map your files to a windows virtual drive for ease of access.
INSTALL SAMBA ON UBUNTU:
sudo apt-get install samba
sudo /etc/init.d/samba start
- check the status via:
sudo /etc/init.d/samba status
- Backup your config:
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bk
- Edit the configuration:
sudo nano /etc/samba/smb.conf
- Exemple of a windows config file:
[global] server string = Samba Server Version %v log file = /var/log/samba/log.%m max log size = 50 security = user passdb backend = tdbsam load printers = yes cups options = raw hosts deny = ALL hosts allow = 192.168.2. guest ok = no wins support = yes workgroup = WORKGROUP [folder_user01] path=/home/user01/ read only = no broweasable = yes valid users = user01 writeable = yes write list = user01 [printers] comment = All Printers path = /var/spool/samba
- Edit the file to your taste, check the documentation here: https://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html
- Add the user to samba:
sudo smbpasswd -a user01
and then type the password when prompted to
- Restart samba:
sudo /etc/init.d/samba restart
ACCESS YOUR SAMBA SHARE IN WINDOWS:
- Open an explorer windows (WIN+E)
- In the address bar hit: \\192.168.2.20 (The ip address of your linux computer -> see Static IP)
- hit Enter
- If the connection is working, you will see the folders or will be prompt for username/passwords. If are having a timout issue, you might want to check your firewall settings in linux.
- If you are prompt for username/password and you should be: Enter the credential you just set via
smbpasswdcommand in linux.
CREATE PERMANENT CREDENTIALS IN WINDOWS:
- In the control panel search for: User Accounts
- On left bar click on: Manage your credentials
- Click on: Add a Windows credential
- Type your linux ip address i.e. : \\192.168.2.20
- Then type the username and password of the user you granted the access to.
- If everthing went well, you should have something like this:
- Now if you connect to your file you won’t be prompted for username/password anymore