Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Other Community Discussions > Tutorials & Tips
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Ubuntu 9.10 is out!!!

When downloading Ubuntu 9.10 please consider using bittorrent to get your copy of Ubuntu.

The Ubuntu Developers Summit for Lucid Lynx will be held the week of 16-Nov-2009 till 20-Nov-2009 in Dallas, TX USA. Visit the the Ubuntu wiki for more information about UDS and how to participate remotely.

Tutorials & Tips
The place to find Ubuntu related Tips & Tricks.

 
Thread Tools Display Modes
Old October 27th, 2004   #1
Vulc
Just Give Me the Beans!
 
Vulc's Avatar
 
Join Date: Oct 2004
Location: Rochester, NY
Beans: 39
HOW TO: Setup Samba Over A Linux Network.

hey guys, I wanted to share a folder on my laptop with my desktop (both linux) how do I do it?
Vulc is offline   Reply With Quote
Old October 27th, 2004   #2
jdong
Ultimate Coffee Grinder
 
jdong's Avatar
 
Join Date: Oct 2004
Location: Cambridge. MA
Beans: 5,063
Ubuntu 8.10 Intrepid Ibex
Re: how do I set up linux network shares?

the most typical way is by configuring a program called samba. It's a Windows File Sharing server/client for Linux. There are plenty of guides on Google about how to do this.


I recommend that you use SSH. Though technically not a file sharing protocol, it's easy to set up, plus very simple to extend over a larger network. It's the best solution when both systems run Linux. Plus, traffic is encrypted, giving you an extra sense of security, especially if there's untrusted people on your network (or you're going through the internet!)

First, use apt-get install ssh to install the SSH server. Do this on both systems.

Open up a file browser (using any folder on the Computer menu). Go to File, select Connect to Server. Choose SSH as the protocol, fill in appropriate login names and such.
jdong is offline   Reply With Quote
Old October 27th, 2004   #3
FLeiXiuS
Extra Foam Sugar Free Ubuntu
 
FLeiXiuS's Avatar
 
Join Date: Oct 2004
Location: Binary Land, Maryland
Beans: 635
Send a message via AIM to FLeiXiuS
Re: how do I set up linux network shares?

I wouldn't agree with SSH to share files. Thats not the way you would want to go. I would reccomend installing samba / swat. (SWAT is optional)

First lets begin by setting up SAMBA!

Installing...
Code:
sudo apt-get install samba
Configuring /etc/smb.conf
We will be creating a whole new samba config because we are the guru's and it improves validity. .

1. Rename /etc/smb.conf to /etc/smb.conf.old
2. Open /etc/smb.conf with your favorite text editor!


Code:
; /etc/smb.conf
;
; Make sure and restart the server after making changes to this file, ex:
; /etc/rc.d/init.d/smb stop
; /etc/rc.d/init.d/smb start

[global]
; Uncomment this if you want a guest account
; guest account = nobody
   log file = /var/log/samba-log.%m
   lock directory = /var/lock/samba
   share modes = yes

[homes]
   comment = Home Directories
   browseable = no
   read only = no
   create mode = 0750

[tmp]
   comment = Temporary file space
   path = /tmp
   read only = no
   public = yes
NOTE: If your Samba server has more than one ethernet interface, the smbd may bind to the wrong one. If so, you can force it to bind to the intended one by adding a line that looks like this to the [global] section of /etc/smb.conf:

Code:
"interfaces = 192.168.1.1/24"
Replace the IP above with the interfaces IP address. Notice the /24 at the end. This is the subnet default for a CLASS-C network. It may vary depending on your network.

To share a directory with the public, create a clone of the [tmp] section above by adding something like this to smb.conf:

Code:
[public]
   comment = Public Stuff
   path = /home/public
   public = yes
   writable = yes
   printable = no
To make the above directory readable by the public, but only writable by people in group ubuntu, modify the entry like this:

Code:
[public]
   comment = Public Stuff
   path = /home/public
   public = yes
   writable = yes
   printable = no
   write list = @ubuntu
After this I would reccommend setting up samba for encrypted passwords.
In the [global] section of /etc/smb.conf, add the following lines:
Code:
encrypt passwords = yes
smb passwd file = /etc/smbpasswd
NOTE: If your clients and server are using encrypted passwords, you will not be able to browse the available shares on the server until an initial connection has been made with the appropriate authentication.

This should be all, save and exit.

Starting SMB Daemons
Code:
sudo /usr/sbin/smbd -D && /usr/sbin/nmbd -D
Accessing Shared Folder on Another Linux Box
To see which shares are available on a given host, run:
Code:
/usr/bin/smbclient -L host

Example:
/usr/bin/smbclient -L fleixius
Where 'host' is replaced with the hostname of the samba server on the network. Unless the SMB server has no security configured, it will ask you for a password. This should print back a service page. Where services are what the host can share to you.

To view the shared folder 'public' on machine 'fleixius' (//fleixius/public) you will need to:
Code:
/usr/bin/smbclient service <password>

Example:
/usr/bin/smbclient ////fleixius/public  mypwd
Because of shell restrictions you have to escape the backslashes.

Now once your in the 'smb: \' console. You can type 'h' for a help menu.

Mounting a Shared Drive
Using the examples above, lets say we want to mount a folder called "Ubuntu" shared on "fleixius" to a directory of "/home/Ubuntu" on the local box. The typical mount command would be as following:

Code:
smbmount "\\\\fleixius\\Ubuntu" -U rtg2t -c 'mount /home/Ubuntu -u 1000 -g 1000'
Notice -u and -g. UID and GID. Replace those with your values also.

I hope this helps and solves the problems with samba. Please send feedback!
__________________
Regards,
FL-ei-|X|-iu-S
][ My Blog ][
FLeiXiuS is offline   Reply With Quote
Old October 28th, 2004   #4
Vulc
Just Give Me the Beans!
 
Vulc's Avatar
 
Join Date: Oct 2004
Location: Rochester, NY
Beans: 39
Re: how do I set up linux network shares?

k I followed the guide as written but I get this error

vulcanon@Vulcari:/etc/samba $ sudo /usr/bin/smbclient -L Vulcari
Password:
session setup failed: NT_STATUS_LOGON_FAILURE

gave the correct password too

Last edited by Vulc; October 28th, 2004 at 12:22 AM..
Vulc is offline   Reply With Quote
Old October 28th, 2004   #5
strips
5 Cups of Ubuntu
 
Join Date: Oct 2004
Location: Norway, Drammen
Beans: 34
Send a message via ICQ to strips Send a message via MSN to strips
Re: HOW TO: Setup Samba Over A Linux Network.

Why use samba in a pure linux relation?

If you don't need user auth, NFS is the solution.

It's much easyer than samba and you don't get the overhead as with SSH filetransfer.

Server:
http://nfs.sourceforge.net/nfs-howto/server.html

Client:
http://nfs.sourceforge.net/nfs-howto/client.html

Regards
Stian H. Larssen
strips is offline   Reply With Quote
Old October 28th, 2004   #6
strips
5 Cups of Ubuntu
 
Join Date: Oct 2004
Location: Norway, Drammen
Beans: 34
Send a message via ICQ to strips Send a message via MSN to strips
Re: how do I set up linux network shares?

Quote:
Originally Posted by Vulc
k I followed the guide as written but I get this error
vulcanon@Vulcari:/etc/samba $ sudo /usr/bin/smbclient -L Vulcari
Password:
session setup failed: NT_STATUS_LOGON_FAILURE
gave the correct password too
Hi.

Did you add the samba password on the server for the correct user?

smbpasswd
strips is offline   Reply With Quote
Old October 28th, 2004   #7
FLeiXiuS
Extra Foam Sugar Free Ubuntu
 
FLeiXiuS's Avatar
 
Join Date: Oct 2004
Location: Binary Land, Maryland
Beans: 635
Send a message via AIM to FLeiXiuS
Re: HOW TO: Setup Samba Over A Linux Network.

Yes, if a password was set, then enter the password, if not then just push enter.
__________________
Regards,
FL-ei-|X|-iu-S
][ My Blog ][
FLeiXiuS is offline   Reply With Quote
Old October 28th, 2004   #8
emperor
Ubuntu Extra Shot
 
emperor's Avatar
 
Join Date: Oct 2004
Location: Paradise Island, Bahamas
Beans: 359
Ubuntu 9.04 Jaunty Jackalope
Re: HOW TO: Setup Samba Over A Linux Network.

I recommend "nfs" for share folders between native linux machines. Samba works great for Linux to windows. The "nfs" sharers must edit the "/etc/exports" file and the Share-e must mount the drive as defined in the "sharers" export file. You'll need to install "nfs" file utilities on each Linux machine too!

If your UID is the same on both machines, you can read/write with no problem. In a multi-user environment you may not want everyone to be the same UID number (1000). In that case every user would be set to a different UID (1000, 1001, ...) on his machine and on the server side; in other words, a master list of username to UID would be used throughout the network. Every user would have a unique UID.

I used to try and use SAMBA for both Linux and Windows machines, but there are too many "gottchas" with the "rights" thing with Samba and a Linux client.I spent too much time "trying" to force SAMBA on linux when "nfs" just works!
__________________
linxos.com hllug.org bubbasgeek.com
100% Linux/BSD @Home: Ubuntu -hp6810,Desktop,Server,MythTV. Fedora -MythTV, i9300. M0n0WALL -fw/router.

Last edited by emperor; October 28th, 2004 at 01:08 PM..
emperor is offline   Reply With Quote
Old October 28th, 2004   #9
jdong
Ultimate Coffee Grinder
 
jdong's Avatar
 
Join Date: Oct 2004
Location: Cambridge. MA
Beans: 5,063
Ubuntu 8.10 Intrepid Ibex
Re: HOW TO: Setup Samba Over A Linux Network.

Funny thing; I've never had issues with Linux-to-Linux SAMBA. Especially with cifs, which supports POSIX extensions on top of smbfs! YAY
jdong is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:20 PM.


vBulletin ©2000 - 2009, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. bilberry