HowTo: Sharing Files with SMB (LINUX)

WARRANTY: I am not responsible for your screw ups! even if they were caused by my instructions.

I did NOT want this to be my first howto, but whatever…

Sharing files in linux can be somewhat confusing for beginners, that probably why i’m wasting my time writing this. i’ll be using ubuntu for this howto. before i start you will need to install the samba suite (which contains the samba server – the thing you’ll use to share your files). luckily, in ubuntu, that’s as easy as.. well, it’s just easy. you have two options ether use the terminal or use synaptic, i’ll use the terminal.

At the terminal prompt type:
sudo apt-get install samba
or type it directly if your root.

once that little gizmo is done installing the suite, you’ll be ready to share files. I think that the smb server starts immediately after installing.

Sharing directories (“folders”.. whatever):

although i’m sure there’s a way to do it at the terminal. i haven’t bothered searching for it. so i’ll use the gui method…

first open the terminal, and start nautilus with root privs, that is:
sudo nautilus

then, simply right-click on the “folder” you want to share, and choose sharing options. modify options and your set.

adding users to smb:

smb WILL NOT ALLOW users to access shared folders without an account! you’ll first have to create a smb user, and then access the shared folder from that account. for demonstration prepossess, i’ll create an account for user “guest”. to create the account:
sudo smbpasswd -a guest
and your account is ready.

<!> NOTE: /*the crappy sites i visited conveniently forgot to mention this part*/ you will not be able to create a smb account if there isn’t a system user with the same name! so for the previous example, there should be a “guest” account in ubuntu’s user list.

How.. tell me how:

just type in the following command when you press alt+F2 (or in nautilus’s address field):
where 192.168.blablabla is the address of your server (the computer from which you want to share files).

if you use a router, in other words, if you use DHCP, use ifconfig to get the ip of your sever.

and that’s all folks.

C^XC^V: we have a forum you know. if you have a question or just want to argue, please take it to the forum. start a new thread and post it’s title – or better more, it’s link – and i’ll get to you as soon as possible.
blog comments are for comments!


don’t forget to edit the permissions of the shared directory. use

sudo chmod -R 777 [directory]

to modify the directory’s permisions so that anyone with a SMB account can access it. The -R option is to modefy each file and dirctory in [directory].

9 thoughts on “HowTo: Sharing Files with SMB (LINUX)

  1. I really needed that tutorial… it’s annoying to switch to windows JUST FOR FILE SHARING (I’m just lazy to figure something out)

  2. If you need any help, I can teach you how to cut files then put them together (using the terminal)

  3. Yes the split and cat, and no I don’t know them. I’m actually looking for good Kuwaiti Linux users, but it seems they’re very rare.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.