File Sharing using SMB

even though I’ve posted this in another blog, I thought you guys might find this useful…

WARRANTY: I am not responsible for anything written here. do it at your own risk!

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 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):
smb://192.168.2.10
where the ip 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.
SIGTERMer

One Response to “File Sharing using SMB”

  1. SIGTERMer Says:

    ***edit***

    don’t forget to edit the permisions 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].

Leave a Reply