Results 1 to 7 of 7

Thread: smbclient syntax question

  1. #1
    Join Date
    Apr 2006
    Location
    Ireland
    Beans
    168
    Distro
    Ubuntu

    smbclient syntax question

    I am having problems with smbclient on the command line. When I enter the following in Nautilus or Konqueror it works fine:
    Code:
    smb://myADusername@server1.ads.domain.tld/testhome/myADusername
    but similar on the command line gives me an error:
    Code:
    smbclient \\\\server1.ads.domain.tld\\testhome\\myADusername -U 'myADusername%myADpassword'
    Domain=[ADS] OS=[Windows Server 2003 R2 3790 Service Pack 2] Server=[Windows Server 2003 R2 5.2]
    tree connect failed: NT_STATUS_BAD_NETWORK_NAME
    So my question is does anyone know if it is possible to log or see the smbclient command issued by nautilus or konqueror so I can use these as a basis for my own command line stuff?
    Thanks in advance,
    jonny

  2. #2
    Join Date
    Apr 2009
    Beans
    3
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: smbclient syntax question

    Although I do not know the answer to the question presented, one possibility may be due to the fact that the directory 'myADusername' is included in the share path. I just now tested my ability to log in to our server, and it worked fine as long as I did not include a directory in the share path:

    Code:
    smbclient \\\\server.domain.tld\\share -U 'domain\myADusername'
    This will prompt you for a password (I was not able to successfully include a password in the command).



    Including a directory in the share path
    Code:
    smbclient \\\\server.domain.tld\\share\directory -U 'domain\myADusername'
    returns the following message:
    Code:
    Enter XXXX\user's password: 
    Domain=[XXXX] OS=[Windows X.X] Server=[Windows X LAN Manager]
    tree connect failed: NT_STATUS_BAD_NETWORK_NAME

  3. #3
    Join Date
    Apr 2006
    Location
    Ireland
    Beans
    168
    Distro
    Ubuntu

    Re: smbclient syntax question

    Thanks for your reply 209pcs, you've helped me work out that what I should have been doing is:
    Code:
    smbclient \\\\server1.ads.domain.tld\\testhome -U 'myADusername%myADpassword' -c 'cd myADusername; ls'
    So this helps me understand how the command line smbclient works I'm on to my next problem of getting the web interface (phpsmbwebclient) to work the same. Thanks.

  4. #4
    Join Date
    Apr 2006
    Location
    Ireland
    Beans
    168
    Distro
    Ubuntu

    Re: smbclient syntax question

    Incidentally the -D parameter can also be used to set the initial directory:
    smbclient \\\\server1.ads.domain.tld\\testhome -U 'myADusername%myADpassword' -D 'myADusername' -c 'ls'
    Just in case this helps anyone else,
    jonny

  5. #5
    Join Date
    Apr 2009
    Beans
    3
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: smbclient syntax question

    jonnymccullagh,

    I tried the example you posted, and when I attempt to include my password, the cursor simply goes down to the next line and displays a ">". Does the percent sign (%) separate the username and password?


    I'm using Ubuntu 9.10 64-bit, smbclient version 3.4.0

  6. #6
    Join Date
    Apr 2006
    Location
    Ireland
    Beans
    168
    Distro
    Ubuntu

    Re: smbclient syntax question

    Yes the % symbol is to separate the username and password (if you do not want to be prompted for a password.
    From the man page:
    Code:
    -U|--user=username[%password]
    Sets the SMB username or username and password.
    If %password is not specified, the user will be prompted.
    Are you sure you have quoted everything correctly. Usually when I get a > prompt it is because I have an extra apostrophe symbol?
    jonny

  7. #7
    Join Date
    Apr 2009
    Beans
    3
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: smbclient syntax question

    There it is. I have an apostrophe in my password.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •