Announcement

Collapse
No announcement yet.

[resolved] Need help configuring Samba for Vista & Kubuntu Shares

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [resolved] Need help configuring Samba for Vista & Kubuntu Shares

    Hello,

    Let me start by admitting that I'm not very knowledgeable when it comes to networking. But I am currently trying to learn a thing or two.

    I have began using "samba 3 sharing" to access my vista laptop. So far, by researching other how-to articles & threads, I am now able to access my kubuntu box from my vista laptop & vice versa. I can open my kubuntu shares from vista, but not able to open my vista shares from kubuntu. When I attempt to open vista shares from my buntu box, there is a password prompt in which I enter my samba name & password, but get a message "access denied".

    let me stop right here and provide some info that may be relevant to anyone who is willing to help.

    Code:
    ben@HP:~$ smbclient -L //HP
    
    Domain=[HOME] OS=[Unix] Server=[Samba 3.4.0]
    
        Sharename    Type   Comment
        ---------    ----   -------
        print$     Disk   Printer Drivers
        HOME      Disk
        SDB8      Disk
        IPC$      IPC    IPC Service (HP server (Samba, Ubuntu))
    Domain=[HOME] OS=[Unix] Server=[Samba 3.4.0]
    
        Server        Comment
        ---------      -------
        HP          HP server (Samba, Ubuntu)
        OWNER-PC       LAPTOP
    
        Workgroup      Master
        ---------      -------
        HOME         HP
    Code:
    ben@HP:~$ smbclient -L BIGSERVER
    
    Connection to BIGSERVER failed (Error NT_STATUS_BAD_NETWORK_NAME)
    *****smb.conf******

    Code:
    [global]
        workgroup = HOME
        server string = %h server (Samba, Ubuntu)
        map to guest = Bad User
        obey pam restrictions = Yes
        pam password change = Yes
        passwd program = /usr/bin/passwd %u
        passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
        unix password sync = Yes
        client NTLMv2 auth = Yes
        syslog = 0
        log file = /var/log/samba/log.%m
        max log size = 1000
        dns proxy = No
        usershare allow guests = Yes
        panic action = /usr/share/samba/panic-action %d
    
    [printers]
        comment = All Printers
        path = /var/spool/samba
        create mask = 0700
        printable = Yes
        browseable = No
        browsable = No
    
    [print$]
        comment = Printer Drivers
        path = /var/lib/samba/printers
    
    [HOME]
        path = /home
        read only = No
        guest ok = Yes
    
    [SDB8]
        path = /media/sdb8
        read only = No
        guest ok = Yes

    Does anyone know how to get me on track to accessing my vista shares from buntu? Also, I welcome any suggestions, warnings, or recommendations.
    System<br />HP Pavilion 061 with dual boot,&nbsp; Kubuntu Lucid 10.04 &amp; Windows XP Professional SP3<br />model#: PU061AV<br />X-86 based PC<br />AMD Athlon 64 processor 3200+1.79GHz<br />2 GB of RAM<br />Video:NVIDIA GeForce FX 5200 (dedicated)<br />hard drive: Maxtor 6Y080M0, 60GB

    #2
    Re: Need help configuring Samba for Vista &amp; Kubuntu Shares

    I got this from a site a cannot remember (it worked for me)....

    To Access shared Vista folders from a Linux machine.

    Part 1

    There are two possible reasons why a Vista user can’t connect to a Linux share:

    1. Windows Vista changes the authentication method for password-protected shares. In XP and previous versions, the system by default used two password hashes, the old-style LAN Manager (LM) and the newer NTLM version 2 (NTLMv2). (If you want the gory details, read this excellent article by Windows security guru Jesper Johansson. Although it was written using a beta version of Vista, the information is still accurate.) Older versions of the Samba server in Linux use only the LM hash, which means they have no trouble connecting to a default installation of XP but will fail when trying to talk to a default installation of Vista.

    To fix this problem, you need to update the version of Samba on the Linux machine to 3.0.22 or higher. (If you’re using an earlier Samba version, you can downgrade Vista’s authentication to accept LM hashes, using either Local Security Policy Manager or a registry edit. I don’t recommend this option.)

    2. Challenge #2 was to get Samba configured on the Ubuntu Linux machine. In my case, the samba-common package was installed and was at the correct revision (3.0.22–1), but the samba package itself was missing. (Update: On a second machine when I tried a clean install, smbfs was missing as well, and I was unsuccessful until I installed it.) After I installed the missing pieces, I had one more step to run through. From a Terminal window, I needed to add a Samba user and password. Windows users are accustomed to having file sharing and authentication handled using the credentials for their user account, but with a Samba server the databases are different. The syntax, in my case, was fairly straightforward:

    sudo smbpasswd -a username

    In this command, username is the same as my account name. You can create an account for another user as long as they already exist in the user account database.

    (Note that you have to respond to three password prompts at this point. The first is for the root password of the logged-on user, and the next two set the SMB password for the user whose account you’re adding.)

    After going through these steps, I was able to access shared folders on the Linux machine.

    Part 2

    Changes in the architecture of Windows Vista make it more difficult to connect to Vista shares from Linux machines. If you browse the network from Linux (network:///), you can see other machines, including those running any version of Windows. If you double-click the icon for a computer running Windows XP, you can see a list of shared resources on that computer. You can also connect to those resources if you have the correct password. But if you try the same thing with a computer running Windows Vista, you’ll find yourself unable to view the shares, much less connect to them.

    Fortunately, there are a couple of workarounds.

    For quick access to a shared folder on a machine running Windows Vista, first create an empty folder in your Home directory, using a name that describes the shared files. Next, open a Terminal window and enter the following command, all on one line:

    sudo mount -t smbfs -o username=windows_username,password=windows_passwor d
    //vista_pc_name/share_name mount_folder_name

    Substitute your Windows username and password for the values in red. Use the UNC path for the Windows share, and replace mount_folder_name with the full path of the folder you created (in my case, I created a folder called shared_vista, so the path I used was /home/robert/shared_vista). Be sure not to add a space after the comma and before the word password.

    [Update: smbfs is deprecated and no longer maintained. You can safely substitute cifs for smbfs in the command line above.]

    This technique works fine for quick access to shared files on a Vista machine, but there are two limitations. First, the mounted folder isn’t persistent. If you restart your machine, you’ll have to execute the mount command again to gain access to those shared files. Second, access to the Vista folder is read-only. That’s fine if you just want to copy some files from your Vista machine to the Linux box, but it’s a nuisance if you want to go the other direction.

    Part 3

    1. Choose a name to use for the shared folder on your Linux machine, such as vista_public. Open a Terminal window and issue the command sudo mkdir /mnt/vista_public (if you chose a different name to identify the shared folder, substitute it for vista_public). This creates a directory that will be used as the mount point for your shared folder.

    2. Using a text editor, create a plain text file containing two lines:

    username=windows_username
    password=windows_password

    Substitute your actual Windows username and password for the italicized text. Save the file in your home folder as .smbpasswd (don’t forget the dot at the beginning of the filename, which makes the file hidden). Finally, change the permissions on the file so only you can open and change it by issuing the following command in a Terminal window:

    chmod 600 .smbpasswd

    3. On the Linux machine, open /etc/fstab in a text editor. (On Ubuntu, I used the command sudo gedit /etc/fstab. You can use another editor if you prefer.)

    4. At the end of the file, add a new line containing the following:

    //vista_pc_name/share_name mount_folder_name smbfs credentials=/home/linux_username/.smbpasswd,uid=linux_username,gid=users 0 0

    Use the UNC path for the Windows share, and replace mount_folder_name with the full path of the folder you created in Step 1 (in this example, /mnt/vista_public). Substitute your Linux username for the values in red. These credentials will be passed to the Vista machine. (Note: there’s no space after the comma and before the uid and gid.) [Update: Thanks to Jeremy Allison in the comments of the previous post for pointing out that smbfs is deprecated and no longer maintained. You can safely substitute cifs for smbfs in the fstab entry.]

    5. Save the file and, in the Terminal window, issue the command sudo mount -a.

    6. Create a link in your Home folder or on the desktop to the location you created in Step 1 (in this example, /mnt/vista_public) and give the link a descriptive name. Click OK to save it.

    You now have a shortcut (link, in Linux-speak) that you can use to to access files in your shared Vista folder. If you find that subfolders in the shared folder are set as read-only, right-click the folder on the Linux box, choose Properties, and click the Permissions tab.

    Comment


      #3
      Re: Need help configuring Samba for Vista &amp; Kubuntu Shares

      robfish,

      Just want to say THANK YOU! That worked like a charm.

      I didn't feel as if Part 1 was the problem. The limitations in Part 2 turned me off to that option. So I put Part 3 to work and voila! I can now access my vista laptop from buntu & vise versa. I even have me a nifty little "link" that I use to access the laptop. Sweeeeeeeet! 8)
      System<br />HP Pavilion 061 with dual boot,&nbsp; Kubuntu Lucid 10.04 &amp; Windows XP Professional SP3<br />model#: PU061AV<br />X-86 based PC<br />AMD Athlon 64 processor 3200+1.79GHz<br />2 GB of RAM<br />Video:NVIDIA GeForce FX 5200 (dedicated)<br />hard drive: Maxtor 6Y080M0, 60GB

      Comment

      Working...
      X