You are not logged in.

#1 2018-10-01 03:57:58

aleksozolins
Member
Registered: 2018-09-28
Posts: 15

Cannot Access Samba Shares in Midnight Commander - MC

Hello Friends,

I've tried both the Arch repository and the AUR versions of MC. The PKGBUILD does seems to indicate that SMB is included. I have no problem accessing my Samba shares through PCMANFM, but for some reason I can't through MC. In the SMB link to machine dialogue I've tried:

smb://thinkpad/directoryname
thinkpad
thinkpad.local
smb://thinkpad.local
smb://192.168.1.95 (and all variations)

In the followup dialogue I've tried my username in all caps and all lowercase. From other instances username doesn't seem to be case sensitive. Am I wrong on this?

Whatever I do "Cannot chdir to (machine name)" is returned.

Any help greatly appreciated.

Last edited by aleksozolins (2018-10-01 04:26:18)

Offline

#2 2018-10-02 15:17:10

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,919

Re: Cannot Access Samba Shares in Midnight Commander - MC

Is smbclient installed and does it see the shares ?

Does manual mounting the shares work ?

https://wiki.archlinux.org/index.php/Samba#Client


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2018-10-02 15:43:44

aleksozolins
Member
Registered: 2018-09-28
Posts: 15

Re: Cannot Access Samba Shares in Midnight Commander - MC

Thanks for the reply.

smbclient is installed.

smbclient -L thinkpad -U%
returns the correct shares on that machine (and other machines when I sub the machine name)

smbtree -b -N
only returns the shared hard drive hooked directly to my router under WORKGROUP.

I have "workgroup = WORKGROUP" declared in smb.conf on all my machines so it's curious that the smbtree command isn't showing the shares for all machines. I'm sure it's something silly I'm overlooking.

I should add that in the password/username/workgroup dialogue in MC I'm entering WORKGROUP.

Last edited by aleksozolins (2018-10-02 15:45:41)

Offline

#4 2018-10-02 16:20:50

aleksozolins
Member
Registered: 2018-09-28
Posts: 15

Re: Cannot Access Samba Shares in Midnight Commander - MC

manual mounting of the shares works without problem.

Offline

#5 2018-10-02 18:10:19

romstor
Member
Registered: 2018-08-18
Posts: 54

Re: Cannot Access Samba Shares in Midnight Commander - MC

Did you try F9 -> Left (or Right) -> SMB Link... menu?

Last edited by romstor (2018-10-02 18:10:37)

Offline

#6 2018-10-02 18:11:53

aleksozolins
Member
Registered: 2018-09-28
Posts: 15

Re: Cannot Access Samba Shares in Midnight Commander - MC

Yes. "In the SMB link to machine dialogue I've tried..."

Offline

#7 2018-10-06 22:11:43

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,919

Re: Cannot Access Samba Shares in Midnight Commander - MC

copied from https://unix.stackexchange.com/question … n-smb-conn

SMB File System                                                                 

The smbfs allows you to manipulate files on remote machines with SMB (or CIFS) 
protocol. These include Windows for Workgroups, Windows 9x/ME/XP, Windows NT,   
Windows 2000 and Samba. To actually use it, you may try to use the panel       
command "SMB link..." (accessible from the menubar) or you may directly change 
your current directory to it using the cd command to a path name that looks     
like this:                                                                     

smb://[user@]machine[/service][/remote-dir]                                     

The user, service and remote-dir elements are optional. The user, domain and   
password can be specified in an input dialog.                                   

Examples:                                                                       

    smb://machine/Share                                                         
    smb://other_machine                                                         
    smb://guest@machine/Public/Irlex

have you tried cd smb://somepath from command line ?
If it also fails maybe there's output that helps to determine what goes wrong.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#8 2018-10-06 22:34:28

aleksozolins
Member
Registered: 2018-09-28
Posts: 15

Re: Cannot Access Samba Shares in Midnight Commander - MC

Thanks Lone-Wolf.

Indeed cd smb:// etc in all the iterations I can think of fails for me although mounting shares from the command line works.
"No such file or directory" is returned.

Any ideas?

Offline

#9 2018-10-06 22:57:19

aleksozolins
Member
Registered: 2018-09-28
Posts: 15

Re: Cannot Access Samba Shares in Midnight Commander - MC

More info: I can use smbclient //machinename/folder to gain access from the command line.

Offline

#10 2018-10-07 09:22:16

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,919

Re: Cannot Access Samba Shares in Midnight Commander - MC

was mc active when you tried cd smb ?
(if  not, try with mc active in the same terminal)

Do root and your normal user both have this issue ?
Does it work for a newly created user ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#11 2018-10-07 11:45:37

aleksozolins
Member
Registered: 2018-09-28
Posts: 15

Re: Cannot Access Samba Shares in Midnight Commander - MC

I did indeed try with mc both active and inactive with similar results, and now have tried as root as well. No change in behavior. I either get "cannot chdir to xxxxxx" or "cannnot chdir to xxxxx { permission denied". It doesn't seem to matter whether I type a real or nonsensical smb address...

Newly created user has the same issue.

Offline

#12 2022-01-27 03:26:23

Kubuntu4Life
Member
Registered: 2022-01-27
Posts: 1

Re: Cannot Access Samba Shares in Midnight Commander - MC

I know this thread is 3+ years old but some followup for those that are hitting this thread with Google searches for midnight commander and smb

Make sure midnight commander is compiled with the smb virtual filesystem enabled (by default, smb is not enabled).

$> mc -V
GNU Midnight Commander 4.8.19
Built with GLib 2.56.4
Using the S-Lang library with terminfo database
With builtin Editor
With subshell support as default
With support for background operations
With mouse support on xterm and Linux console
With support for X11 events
With internationalization support
With multiple codepages support
Virtual File Systems: cpiofs, tarfs, sfs, extfs, ext2undelfs, ftpfs, sftpfs, fish, smbfs
Data types: char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;

if smbfs is not listed after virtual file systems, midnight commander won't be able to access windows shares.

This post details how to compile your own version of midnight commander with smbfs enabled.   (It looks scary but it's straightforward)

https://superuser.com/questions/468663/ … b-support]

Offline

Board footer

Powered by FluxBB