LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Small thing: starting samba for the first time. (https://www.linuxquestions.org/questions/linux-networking-3/small-thing-starting-samba-for-the-first-time-263521/)

ditch* 12-07-2004 02:18 AM

Small thing: starting samba for the first time.
 
Heij!

I've recently switched to Mandrake 10.0 and I need to share some files over my university's LAN.

I ran some utility in the Mandrake Control Centre and it installed the following packages:

samba-client
samba-common
samba-server

all are version 3.0.2a

... Unfortunately there doesn't seem to be any README files, so here are the first two questions that come to my mind:

- how do I find out my computer's name?
- how do I view all the other computers connected to LAN?


Sorry for the silly questions.

:)

Grisha.

linux_terror 12-07-2004 02:41 AM

Take a look at /etc/samba/smb.conf this is where all the information you are looking for is, your network name is whatever your hostname is, do

#hostname

workgroup and shares are defined in smb.conf

Hope this helps,
linux_terror

ditch* 12-07-2004 05:38 AM

Thanks!!

[grisha@localhost grisha]$ su
[root@localhost grisha]# hostname
localhost
[root@localhost grisha]#

-- Does this mean that when the others open their Network Neigbourhood windows, they will see my computer listed as "localhost"?

OK.
So what's the Linux version of Network Neighbourhood?
- Where do I go to see who is online and who is not?

Best,

Grisha.

ditch* 12-07-2004 06:01 AM

hmmm...

My flatmate couldn't find anyone named "localhost" on the network.

In fact, it looked like his computer called itself "localhost" as well.

:(

michaelk 12-07-2004 06:53 AM

Some distros use localhost as a default hostname. localhost is the name associated with the ethernet local loopback device 127.0.0.1 which all TCP/IP configured computers will have. Add the option to the /etc/samba/smb.conf file:
netbios name = something

Change something as desired. So something will be displayed in network neighboorhood.

Use Mandrake Control Center services to configure samba to start at boot.

gani 12-07-2004 07:19 AM

It should be defined in your /etc/hosts like this:

Code:

127.0.0.1    localhost.my.domain localhost
127.0.0.1    yourhostname.my.domain yourhostname
192.168.x.x  winhost1
192.168.x.x  winhost2
so on, so forth

With this you can just ping your remote windows machines via its hostname instead of their IPs.

In your /etc/samba/smb.conf, it is already defined by default under the [global] settings:

server string = Samba Server %v

and make sure that security = share is there to allow your windows machines to have full access to the share you will define under Share Definitions such as this:

===============Share Definitions==================
[ourdata]
comment = Central Data Folder
path = /usr/data
public = yes
read only = no
create mode = 0777
directory mode = 0777


Then put the appropriate directory permissions:

#mkdir -m 1777 /usr/data

or

#mkdir /usr/data
#chmod 1777 /usr/data

The "1" will add sticky bit so that the owner (the one that created) the files and directory has only the capacity to delete.

Issue testparm to test for errors in your smb.conf.

To test your samba server:

#smbclient -L localhost

This should list the share you defined and what host is the master browser and including your workgroup such as this:

Code:

obsd c:\># smbclient -L localhost
added interface ip=192.168.0.1 bcast=192.168.0.255 nmask=255.255.255.0
Password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 2.2.10]

        Sharename      Type      Comment
        ---------      ----      -------
        tmp            Disk      Temporary file space
        IPC$          IPC      IPC Service (Samba Server)
        ADMIN$        Disk      IPC Service (Samba Server)
       
        Server              Comment
        ---------            -------
        HOME
        MKTG
        OBSD                Samba Server

        Workgroup            Master
        ---------            -------
        WORKGROUP            OBSD

Always restart your samba server whenever changes are made in smb.conf.

#kill -1 `cat /var/run/smbd.pid`

If you have lmhosts file in your windows boxes with a format like /etc/hosts, you can ping the mandrake box by using its hostname but without this, ping only using its IP address.

You should be able now to access your mandrake share through My Network Places or Network Neighborhood.

Hope that this helps.


All times are GMT -5. The time now is 05:37 PM.