Showing posts with label Samba. Show all posts
Showing posts with label Samba. Show all posts

Monday, November 26, 2012

Samba setup in Ubuntu 10.04

http://ubuntuforums.org/showthread.php?t=1468498

First, you’ll need to install Samba. Fire up a Terminal window and use this command:

sudo apt-get install samba

Follow the default prompts to install Samba. Now, Samba uses a separate set of passwords than the standard Linux system accounts (stored in /etc/samba/smbpasswd), so you’ll need to create a Samba password for yourself with this command:

sudo smbpasswd -a USERNAME

(USERNAME, of course, is your actual username.)

Type a suitably strong password (make sure it includes uppercase, lowercase, punctuation, and numbers). Once your password is created, the next step is to edit your /etc/samba/smb.conf file, the configuration file for Samba. Begin by creating a folder named ‘test’ on your home folder; we’ll use that for our test shared folder (you can create other shared folders using the same method):

mkdir /home/USERNAME/test

Next, make a safe backup copy of the original smb.conf file to your home folder, in case you make an error:

sudo cp /etc/samba/smb.conf ~

Now use your text editor of choice to edit smb.conf:

sudo gedit /etc/samba/smb.conf

(New users will probably find gedit the easiest to use due to its GUI; but you can use emacs or vi just as readily, especially if you’re using the server version of Ubuntu, which doesn’t include X11 by default.)

Once smb.conf has loaded, add this to the very end of the file:

[test]
path = /home/USERNAME/test
available = yes
valid users = USERNAME
read only = no
browsable = yes
public = yes
writable = yes


(There should be no spaces between the lines, and note also that there should be a single space both before and after each of the equal signs.)

These settings will share the test folder we created earlier, and give your username and your username alone permission to read and write to the folder. Once you have input the changes, save smb.conf, exit the text editor, and restart Samba with this command:

sudo restart smbd

Once Samba has restarted, use this command to check your smb.conf for any syntax errors:

sudo testparm

If you pass the testparm command, Samba should be working; try accessing the shared folder from another computer on your LAN.

-JM

Wednesday, September 21, 2011

Open Samba Shares in Nautilus

Open Nautilus

Press Ctrl+L (or use menu: Go > Location)

Type: smb://192.168.123.123 (using IP of target share)

And you're in...

Monday, May 9, 2011

Samba setup in Ubuntu 10.04

Things I wanted to accomplish:
- Share files on internal Harddrives
- Share files on external USB Harddrives that are frequently disconnected

I tried NFS first, but for whatever reason, it was slow and frequently caused the PCs to freeze if shares were not unmounted prior to being disconnected. Samba has been much more forgiving.

Folder sharing
To share a folder, right-click on it and select Sharing Options. If you're not setup for sharing, it will prompt you to install some packages. Change the share name if it complains that it already exists.

External USB Harddrive sharing
Instead of sharing the actual harddrive, I created a symbolic link in my home folder to /media for USB harddrives that were frequently disconnected.

Samba is not setup to follow symbolic links by default, so this must be enabled. Add to /etc/samba/smb.conf in [global] section:
follow symlinks = yes
wide links = yes
unix extensions = no

Restart samba via the terminal:
$ sudo restart smbd
Quirks
  • Using shares-admin doesn't show shared folders...
  • Looking at smb.conf doesn't show shared folders...
  • Sometimes folders don't show as being shared in nautilus, but they are...