Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Ubuntu linux [hardy] Samba trouble


  • Please log in to reply

#1
sasuke781

sasuke781

    Banned

  • Banned
  • PipPip
  • 54 posts
i need some help with samba, im stuck at the "connect to <hostname>" login screen on windows xp sad.gif i have users setup and i have shares setup, but it wont let me into it. I have the samba gui installed but surprisingly i had everything set right before then and i just cant connect to the shares. please help?
  • 0

Advertisements


#2
Titan8990

Titan8990

    Member

  • Member
  • PipPipPipPipPip
  • 2,189 posts
Are you trying to connect to your Windows box from your Linux box? If so, I believe the syntax is: smb:///<ip or hostname here>/. Can either computer see the other? Lastly, post your smb.conf file.
  • 0

#3
sasuke781

sasuke781

    Banned

  • Topic Starter
  • Banned
  • PipPip
  • 54 posts
Ok well heres where im at in more detail. On windows, when i view workgroup computers and then go to the share, i double click it and thats when the screen im talking about comes up. its the same when i try yo map the share. and lastly my smb.conf.....

#
# Sample configuration file for the Samba suite for Debian GNU/Linux.
#
#
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which
# are not shown in this example
#
# Any line which starts with a ; (semi-colon) or a # (hash)
# is a comment and is ignored. In this example we will use a #
# for commentary and a ; for parts of the config file that you
# may wish to enable
#
# NOTE: Whenever you modify this file you should run the command
# "testparm" to check that you have not made any basic syntactic
# errors.
#

#======================= Global Settings =======================

[global]

## Browsing/Identification ###

# Change this to the workgroup/NT-domain name your Samba server will part of
workgroup = lyoko

# server string is the equivalent of the NT Description field
server string = %h server (Samba, Ubuntu)

# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable its WINS Server
; wins support = no

# WINS Server - Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
; wins server = w.x.y.z

# This will prevent nmbd to search for NetBIOS names through DNS.
dns proxy = no

# What naming service and in what order should we use to resolve host names
# to IP addresses
; name resolve order = lmhosts host wins bcast

#### Networking ####

# The specific set of interfaces / networks to bind to
# This can be either the interface name or an IP address/netmask;
# interface names are normally preferred
; interfaces = 127.0.0.0/8 eth0

# Only bind to the named interfaces and/or networks; you must use the
# 'interfaces' option above to use this.
# It is recommended that you enable this feature if your Samba machine is
# not protected by a firewall or is a firewall itself. However, this
# option cannot handle dynamic or non-broadcast interfaces correctly.
; bind interfaces only = true



#### Debugging/Accounting ####

# This tells Samba to use a separate log file for each machine
# that connects
log file = /var/log/samba/log.%m

# Cap the size of the individual log files (in KiB).
max log size = 1000

# If you want Samba to only log through syslog then set the following
# parameter to 'yes'.
; syslog only = no

# We want Samba to log a minimum amount of information to syslog. Everything
# should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log
# through syslog you should set the following parameter to something higher.
syslog = 0

# Do something sensible when Samba crashes: mail the admin a backtrace
panic action = /usr/share/samba/panic-action %d


####### Authentication #######

# "security = user" is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html
# in the samba-doc package for details.
security = user

# You may wish to use password encryption. See the section on
# 'encrypt passwords' in the smb.conf(5) manpage before enabling.
; encrypt passwords = yes

# If you are using encrypted passwords, Samba will need to know what
# password database type you are using.
passdb backend = tdbsam

obey pam restrictions = yes

; guest account = nobody
invalid users = root

# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.
unix password sync = yes

# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Ian Kahan <<[email protected]> for
# sending the correct chat script for the passwd program in Debian Sarge).
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .

# This boolean controls whether PAM will be used for password changes
# when requested by an SMB client instead of the program listed in
# 'passwd program'. The default is 'no'.
pam password change = yes

# This option controls how nsuccessful authentication attempts are mapped
# to anonymous connections
map to guest = bad user

########## Domains ###########

# Is this machine able to authenticate users. Both PDC and BDC
# must have this setting enabled. If you are the BDC you must
# change the 'domain master' setting to no
#
; domain logons = yes
#
# The following setting only takes effect if 'domain logons' is set
# It specifies the location of the user's profile directory
# from the client point of view)
# The following required a [profiles] share to be setup on the
# samba server (see below)
; logon path = \\%N\profiles\%U
# Another common choice is storing the profile in the user's home directory
; logon path = \\%n\%u\profile

# The following setting only takes effect if 'domain logons' is set
# It specifies the location of a user's home directory (from the client
# point of view)
; logon drive = H:
; logon home = \\%n\%u

# The following setting only takes effect if 'domain logons' is set
# It specifies the script to run during logon. The script must be stored
# in the [netlogon] share
# NOTE: Must be store in 'DOS' file format convention
; logon script = logon.cmd

# This allows Unix users to be created on the domain controller via the SAMR
# RPC pipe. The example command creates a user account with a disabled Unix
# password; please adapt to your needs
; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u

########## Printing ##########

# If you want to automatically load your printer list rather
# than setting them up individually then you'll need this
; load printers = yes

# lpr(ng) printing. You may wish to override the location of the
# printcap file
; printing = bsd
; printcap name = /etc/printcap

# CUPS printing. See also the cupsaddsmb(8) manpage in the
# cupsys-client package.
; printing = cups
; printcap name = cups

############ Misc ############

# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting
; include = /home/samba/etc/smb.conf.%m

# Most people will find that this option gives better performance.
# See smb.conf(5) and /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/speed.html
# for details
# You may want to add the following on a Linux system:
# SO_RCVBUF=8192 SO_SNDBUF=8192
; socket options = tcp_nodelay

# The following parameter is useful only if you have the linpopup package
# installed. The samba maintainer and the linpopup maintainer are
# working to ease installation and configuration of linpopup and samba.
; message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm %s' &

# Domain Master specifies Samba to be the Domain Master Browser. If this
# machine will be configured as a BDC (a secondary logon server), you
# must set this to 'no'; otherwise, the default behavior is recommended.
; domain master = auto

# Some defaults for winbind (make sure you're not using the ranges
# for something else.)
; idmap uid = 10000-20000
; idmap gid = 10000-20000
; template shell = /bin/bash

# The following was the default behaviour in sarge,
# but samba upstream reverted the default because it might induce
# performance issues in large organizations.
# See Debian bug #368251 for some of the consequences of *not*
# having this setting and smb.conf(5) for details.
; winbind enum groups = yes
; winbind enum users = yes

# Setup usershare options to enable non-root users to share folders
# with the net usershare command.

# Maximum number of usershare. 0 (default) means that usershare is disabled.
; usershare max shares = 100

# Allow users who've been granted usershare privileges to create
# public shares, not just authenticated ones
usershare allow guests = yes
username map = /etc/samba/smbusers
; guest ok = no

#======================= Share Definitions =======================

# Un-comment the following (and tweak the other settings below to suit)
# to enable the default home directory shares. This will share each
# user's home directory as \\server\username
[Volume 1]
comment = Main
; browseable = yes

# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
writeable = yes

# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
create mask = 0700

# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
directory mask = 0700

# By default, \\server\username shares can be connected to by anyone
# with access to the samba server. Un-comment the following parameter
# to make sure that only "username" can connect to \\server\username
# This might need tweaking when using external authentication schemes
path = /media/Volume 1
guest ok = yes

# Un-comment the following and create the netlogon directory for Domain Logons
# (you need to configure Samba to act as a domain controller too.)
;[netlogon]
; comment = Network Logon Service
; path = /home/samba/netlogon
; guest ok = yes
; read only = yes
; share modes = no

# Un-comment the following and create the profiles directory to store
# users profiles (see the "logon path" option above)
# (you need to configure Samba to act as a domain controller too.)
# The path below should be writable by all users so that their
# profile directory may be created the first time they log on
;[profiles]
; comment = Users profiles
; path = /home/samba/profiles
; guest ok = no
; browseable = no
; create mask = 0600
; directory mask = 0700

[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
; guest ok = no
; read only = yes
create mask = 0700

# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
; browseable = yes
; read only = yes
; guest ok = no
# Uncomment to allow remote administration of Windows print drivers.
# Replace 'ntadmin' with the name of the group your admin users are
# members of.
; write list = root, @ntadmin

# A sample share for sharing your CD-ROM with others.
;[cdrom]
; comment = Samba server's CD-ROM
; read only = yes
; locking = no
; path = /cdrom
; guest ok = yes

# The next two parameters show how to auto-mount a CD-ROM when the
# cdrom share is accesed. For this to work /etc/fstab must contain
# an entry like this:
#
# /dev/scd0 /cdrom iso9660 defaults,noauto,ro,user 0 0
#
# The CD-ROM gets unmounted automatically after the connection to the
#
# If you don't want to use auto-mounting/unmounting make sure the CD
# is mounted on /cdrom
#
; preexec = /bin/mount /cdrom
; postexec = /bin/umount /cdrom


hope that helps
  • 0

#4
Titan8990

Titan8990

    Member

  • Member
  • PipPipPipPipPip
  • 2,189 posts
Have you tried connecting using the IP address of the machine as opposed to the hostname? If you want to to connect via hostname you will need to add it to the hosts list on your Windows machine. The host list in XP and Vista is located: %SystemRoot%\system32\drivers\etc\.
  • 0

#5
sasuke781

sasuke781

    Banned

  • Topic Starter
  • Banned
  • PipPip
  • 54 posts
im not sure you know what im talking about yet....maybe this will help.....Posted Image
  • 0

#6
Titan8990

Titan8990

    Member

  • Member
  • PipPipPipPipPip
  • 2,189 posts
What I am saying is instead of "Server1" try the IP address of the server. For example if your username was sasuke and the IP of server1 is 192.168.1.100 then log in like this:

192.168.1.100/sasuke

Also try navigating the same way in Windows Explorer:

//192.168.1.100

Do you have any issues accessing your Windows PC from your Ubuntu server?
  • 0

#7
sasuke781

sasuke781

    Banned

  • Topic Starter
  • Banned
  • PipPip
  • 54 posts
i've never tried to access my windows pc's from the server. Not really needed.

Tried the ip/username and that didnt work either

Just to be sure, what should my user entries look like if i were using the gui....theres 4 places in it....

unix name
Windows name
password
password confirm

(if i remember that right)

my username on windows is my full name and thats what i put for windows name, unix name is root and theres only a drop down menu for that, and then the password i chose
  • 0

#8
Titan8990

Titan8990

    Member

  • Member
  • PipPipPipPipPip
  • 2,189 posts
Alright, starting off.... In a Ubuntu system "root" is locked be default. In debian based OSes regular users can do nearly every administrative task by prefixing commands with "sudo" or "gksudo" for GUI administration. This is done for security reasons. Now, moving along.

You have to create a smbpasswd password for your user. Here is the play by play:

Create a user for yourself. Typically this is your first name. You will do this via the adduser command. First:

$ man adduser

Read up on it a bit then create your user:

$ sudo adduser sasuke sambashare

This will only create a regular user and places them in the sambashare group.

Now you need to give that user a smb password. Start with:

$ man smbpasswd

To use it:

$ sudo smbpasswd sasuke

After you give that user a samba password go ahead an try to view the shares on that server using the authentication data you just put in.

Also, it may help to start using PuTTy + SSH. This is simple to set up.

On the Ubuntu box:

$ sudo apt-get install ssh


On the Windows box:

Download PuTTy

This allows you to securely log in to your Ubuntu box remotely (CLI only).


Let me know how it works out.

Edited by Titan8990, 04 August 2008 - 08:31 PM.

  • 0

#9
sasuke781

sasuke781

    Banned

  • Topic Starter
  • Banned
  • PipPip
  • 54 posts
why do all that when i have a gui -_-.....besides the point i have a user setup and they are added to samba with a password so all that is done

BTW i have ssh configured....
  • 0

#10
Titan8990

Titan8990

    Member

  • Member
  • PipPipPipPipPip
  • 2,189 posts
Because Linux GUIs are not that great. I spent a week trying to hash out an issue with getting openLDAP to work only to find that the GUI was not writing the config file like it was supposed. You seem to want to learn about server administration and the majority of UNIX based servers a) don't have any GUIs b) are administered remotely.

Note the smbpasswd command specifically. Even if the GUI has that feature, do it on the CLI anyways so I can sleep better at night :).

What kind of error are you currently getting when attempting to log in?



Edit: Also, if you get help from the Linux community your help will come in the form of CLI commands. It easier to type a command and have user copy and paste something into the terminal than to tell them how to navigate GUIs.

Edited by Titan8990, 04 August 2008 - 08:54 PM.

  • 0

Advertisements


#11
sasuke781

sasuke781

    Banned

  • Topic Starter
  • Banned
  • PipPip
  • 54 posts
well i ended up trying the CLI way and that didnt work either....here is what i did....

root@Server1:/home/username# $man adduser sasuke
Adding user `sasuke' ...
Adding new group `sasuke' (1001) ...
Adding new user `sasuke' (1001) with group `sasuke' ...
Creating home directory `/home/sasuke' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for sasuke
root@Server1:/home/username# $sudo adduser sasuke sambashare
\Adding user `sasuke' to group `sambashare' ...
Adding user sasuke to group sambashare
Done.
root@Server1:/home/username# \$man smbpasswd sasuke
bash: $man: command not found
root@Server1:/home/username# $sudo smbpasswd sasuke
New SMB password:
Retype new SMB password:
Mismatch - password unchanged.
Unable to get new password.
root@Server1:/home/username# $sudo smbpasswd sasuke
New SMB password:
Retype new SMB password:
Failed to find entry for user sasuke.
Failed to modify password entry for user sasuke
  • 0

#12
Titan8990

Titan8990

    Member

  • Member
  • PipPipPipPipPip
  • 2,189 posts
Again, you really should stop using root, it is bad practice on debain based distros. This is not Windows and I can't stress enough how poor of a practice this is, even by Windows.

None of these commands need a "$". The "$" signifies a "non-root" shell (regular user). You are used to seeing a "#" prompt which indicates a root shell.

This failed because of a typo:

root@Server1:/home/username# \$man smbpasswd sasuke
bash: $man: command not found


I don't know why smbpasswd failed but if I had to guess it was prefixing it with a $ (surprised many of those commands still worked).

Anyways we can force smbpasswd to find your user using the "-a" argument:


$ sudo smbpasswd -a sasuke


Let me know if that works.
  • 0

#13
sasuke781

sasuke781

    Banned

  • Topic Starter
  • Banned
  • PipPip
  • 54 posts
ok now this is odd.....i finally got the smbpasswd to work and went to try it and i got in without a password? o.O this is definately not how i want it since anyone that comes onto my network would be able to get in no problem and screw around =\
  • 0

#14
Titan8990

Titan8990

    Member

  • Member
  • PipPipPipPipPip
  • 2,189 posts
Do you not have a firewall blocking that access from outside the network or are you talking about local access?
  • 0

#15
sasuke781

sasuke781

    Banned

  • Topic Starter
  • Banned
  • PipPip
  • 54 posts
as far as the server....i have no idea. so i guess im talking about both. Does ubuntu come with a firewall....cause i dont know of one if it doesnt
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP