LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-03-2017, 05:02 AM   #1
Peter Pfand
LQ Newbie
 
Registered: Dec 2016
Posts: 6

Rep: Reputation: Disabled
Can't see/mount SMB shares through terminal


Dear Linux Users,
I would like to mount a SAMBA share on my computer, where I'm running Debian 8 (Jessie). The SMB share is located at the server of my institute and works as a domain controller (it's a SAMBA 4). All machines are located inside the private network of the institute.

I can see and mount the shares from a OSX 10.9.5 with:
Code:
smbutil view //<user_name>@<server_domain_name>/share
and:
Code:
mount_smbfs //<user_name>@<server_domain_name>/share ~/my_share
From my computer, I can access the share via nautilus (GNOME nautilus 3.14.1), through the "Connect to Server" option at the sidebar, with:
  • - smb://<server_domain_name>/share as Server Address
    - <user_name>@<domain> as the username
    - <domain>.es as the domain


However, it gives me the following error when using the command-line:
Code:
sudo mount.cifs //<server_domain_name>/share ~/my_share -o user=<user_name>@<domain>,workgroup=<domain>.es
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
I have tried removing the @<domain> part from the user, adding a $ at the end of the server address (//<server_domain_name>/share$), but everything has been unsuccesful.

When I try to connect to the server with smbclient, it gives me another error:
Code:
smbclient  //<server_domain_name>/share --user=<user_name>@<domain> --workgroup=<domain>.es
Enter<user_name>@<domain>.es's password: 
session setup failed: NT_STATUS_LOGON_FAILURE
And I get the same error with:
Code:
 smbclient -L //<server_domain_name>/share -U <domain>/<user_name> -W <domain>.es
It seems to be a Linux-related issue, since it works for OSX but not for Debian (I also tried up in Ubuntu and it did not work). Have I overlooked anything? I am unable to find a solution to this issue and I have been struggling with this more than two weeks...

I would appreciate some hints/comments about this, since I am aware I am not the only one person experiencing this, and after trying multiple apparent solutions from many forums, I still haven't found the right one.

Thanks in advance

Last edited by Peter Pfand; 01-03-2017 at 05:06 AM.
 
Old 01-04-2017, 05:34 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,703

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
If it works using nautilus then it should work on the command line... However, you are using the wrong syntax for user. It is either

user=username or user=workgroup/username

Try using:
Code:
sudo mount -t cifs //server_name/share ~/my_share -o user=username,domain=<domain>.es
See man pages for mount.cifs for more information.
 
Old 01-04-2017, 06:19 AM   #3
Peter Pfand
LQ Newbie
 
Registered: Dec 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
If it works using nautilus then it should work on the command line... However, you are using the wrong syntax for user. It is either

user=username or user=workgroup/username

Try using:
Code:
sudo mount -t cifs //server_name/share ~/my_share -o user=username,domain=<domain>.es
See man pages for mount.cifs for more information.
I get the same error in that case. According to the man pages, it seems to be a permission-related issue. However, if I can access, as you say, via nautilus, I should have access through smbclient or mount.
 
Old 01-04-2017, 01:40 PM   #4
thecarpy
Member
 
Registered: Apr 2005
Location: France
Distribution: Devuan, Suse, Slackware
Posts: 130

Rep: Reputation: 21
I am a bit surprised by your error. I use workgroup= in the options instead of domain=, and it works.

Note that the command first asks for the sudo password, then for the share password.

sudo mount -t cifs //server_name/share ~/my_share -o user=username,workgroup=<domain>

You might want to do a sudo ls before issuing the command, enter sudo password, the you can be sure the password is for the user as specified in the command.
 
Old 01-04-2017, 04:52 PM   #5
c0wb0y
Member
 
Registered: Jan 2012
Location: Inside the oven
Distribution: Windows
Posts: 421

Rep: Reputation: 74
Post the output of:
Code:
grep '^\s*hosts' /etc/samba/smb.conf
Put both the loopback IP and the LAN IP into that 'hosts' line. Then restart samba.

Also, check your samba log file. If still does not work, check your firewall rules.
 
Old 01-05-2017, 03:24 AM   #6
Peter Pfand
LQ Newbie
 
Registered: Dec 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by thecarpy View Post
I am a bit surprised by your error. I use workgroup= in the options instead of domain=, and it works.

Note that the command first asks for the sudo password, then for the share password.

sudo mount -t cifs //server_name/share ~/my_share -o user=username,workgroup=<domain>

You might want to do a sudo ls before issuing the command, enter sudo password, the you can be sure the password is for the user as specified in the command.
I get the same error again.

Quote:
Originally Posted by c0wb0y View Post
Post the output of:
Code:
grep '^\s*hosts' /etc/samba/smb.conf
Put both the loopback IP and the LAN IP into that 'hosts' line. Then restart samba.

Also, check your samba log file. If still does not work, check your firewall rules.
That's weird, I get no output with that grep, but the /etc/samba/smb.conf file exists.
 
Old 01-05-2017, 10:07 AM   #7
risu
LQ Newbie
 
Registered: Feb 2005
Location: Helsinki, Finland
Posts: 19

Rep: Reputation: 2
Is there a password for your share? You could try to specify the password on the command line. Otherwise try the guest option.

Risto
 
Old 01-06-2017, 03:49 AM   #8
c0wb0y
Member
 
Registered: Jan 2012
Location: Inside the oven
Distribution: Windows
Posts: 421

Rep: Reputation: 74
Can you post the server output of:

Code:
pdbedit -L
testparm
Then from the client:
[code]
smbclient -L <server-IP> -U <username>
 
Old 01-06-2017, 03:49 AM   #9
c0wb0y
Member
 
Registered: Jan 2012
Location: Inside the oven
Distribution: Windows
Posts: 421

Rep: Reputation: 74
Can you post the server output of:

Code:
pdbedit -L
testparm
Then from the client:
Code:
smbclient -L <server-IP> -U <username>
 
Old 01-09-2017, 04:53 AM   #10
Sieneskil
LQ Newbie
 
Registered: Jan 2017
Location: Ahmedabad
Posts: 1

Rep: Reputation: Disabled
Code:
    smbutil view //<user_name>@<server_domain_name>/share
    mount_smbfs //<user_name>@<server_domain_name>/share ~/my_share
 
Old 01-09-2017, 09:55 AM   #11
Peter Pfand
LQ Newbie
 
Registered: Dec 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by c0wb0y View Post
Can you post the server output of:

Code:
pdbedit -L
testparm

The server is on a FreeBSD system under oneFS, not Debian/Ubuntu, and we do not know how to (cannot) run such command on it. Any hint is appreciated.

Quote:
Originally Posted by Sieneskil View Post
Code:
    smbutil view //<user_name>@<server_domain_name>/share
    mount_smbfs //<user_name>@<server_domain_name>/share ~/my_share
It is for OSX and it works, I want it to work (with other commands) on Linux.

Quote:
Originally Posted by c0wb0y View Post

Then from the client:
Code:
smbclient -L <server-IP> -U <username>

output of smbclient (it was posted previously):
Code:
session setup failed: NT_STATUS_LOGON_FAILURE

Last edited by Peter Pfand; 01-10-2017 at 06:51 AM.
 
Old 01-21-2017, 07:11 AM   #12
Ratamahatta
Member
 
Registered: Feb 2012
Location: Germany
Distribution: siduction
Posts: 134

Rep: Reputation: 17
Wink GNU's _Not_ Unix, it seems.

Have you checked if ntlmv2 options help? (In my /etc/fstab it is sec=ntlmv2.)
At work, I do a login based on a file in /root. That file has to have the right permissions, though, and there was a change in that before I could use something like
Code:
user=<domain>\<user>
password=<password>
(There's a backslash in between, just as on Windows. Might try that instead of a (forward)slash in some of your commands, too.)
and now I have to use something like
Code:
user=<user>
domain=<domain>
password=<password>
Also, there can not be any excess spaces in that file.
 
Old 03-23-2018, 03:19 PM   #13
vwtech
Member
 
Registered: Dec 2007
Distribution: Fedora, Oracle Linux & Centos
Posts: 197

Rep: Reputation: 26
Talking Thanks!

This tread really helped me! Thanks for posting guys.

Quote:
Originally Posted by Ratamahatta View Post
Have you checked if ntlmv2 options help? (In my /etc/fstab it is sec=ntlmv2.)
At work, I do a login based on a file in /root. That file has to have the right permissions, though, and there was a change in that before I could use something like
Code:
user=<domain>\<user>
password=<password>
(There's a backslash in between, just as on Windows. Might try that instead of a (forward)slash in some of your commands, too.)
and now I have to use something like
Code:
user=<user>
domain=<domain>
password=<password>
Also, there can not be any excess spaces in that file.
 
  


Reply

Tags
debian jessie, mount.cifs, samba mount permission, samba4, smbclient



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows users suddenly unable to mount smb shares brojard28 Linux - Server 5 12-04-2008 04:54 PM
Can you Mount SMB Shares to your /mnt directory?? rtoney5 MEPIS 6 04-28-2008 03:24 PM
Mounting SMB shares - Could not resolve mount point Wynd Linux - Networking 3 04-23-2006 01:15 PM
mount smb shares at boot gvaught Debian 12 06-13-2005 11:34 AM
SMB won't mount Windows Server Shares galliar Linux - Networking 1 05-11-2005 10:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration