{"id":883,"date":"2017-02-15T13:59:41","date_gmt":"2017-02-15T10:59:41","guid":{"rendered":"https:\/\/oss-it.su\/?p=883"},"modified":"2022-01-05T23:23:08","modified_gmt":"2022-01-05T20:23:08","slug":"%d0%b2%d0%ba%d0%bb%d1%8e%d1%87%d0%b5%d0%bd%d0%b8%d0%b5-%d0%bf%d0%be%d0%b4%d0%b4%d0%b5%d1%80%d0%b6%d0%ba%d0%b8-samba-%d0%b2-midnight-commander","status":"publish","type":"post","link":"https:\/\/oss-it.su\/en\/883","title":{"rendered":"Midnight Commander with SMB support"},"content":{"rendered":"<p>The popular console file manager mc is capable of handling Windows network resources (smb share) in the same way as it handles ftp\/sftp. However, this feature is disabled by default. This article will describe how to add samba support to mc.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-919 aligncenter img-responsive\" src=\"https:\/\/oss-it.su\/wp-content\/uploads\/2017\/02\/mc_smb-1.jpg\" alt=\"\" width=\"641\" height=\"315\" srcset=\"https:\/\/oss-it.su\/wp-content\/uploads\/2017\/02\/mc_smb-1.jpg 641w, https:\/\/oss-it.su\/wp-content\/uploads\/2017\/02\/mc_smb-1-300x147.jpg 300w\" sizes=\"auto, (max-width: 641px) 100vw, 641px\" \/><\/p>\n<p>For this we need to rebuild the mc package. On Ubuntu\/Debian (and later Ubuntu\/Debian based operating systems) we will need to pre-install the required dependencies:<\/p>\n<p><code>sudo apt-get build-dep mc<\/code><\/p>\n<p>In Redhat (Fedora, Centos):<\/p>\n<p><code>sudo dnf builddep mc<\/code><\/p>\n<p>Next, you can download the mc source code from the official website, from some third-party sources, or you can clone it from the main github repository:<\/p>\n<p><code>git clone https:\/\/github.com\/MidnightCommander\/mc<\/code><\/p>\n<p>In that case, samba-enabled configuration, compilation and installation can be done with commands:<\/p>\n<p><code>cd mc<br \/>\n.\/autogen.sh<br \/>\n.\/configure --enable-vfs-smb<br \/>\nmake<br \/>\nsudo make install<\/code><\/p>\n<p>Done.<\/p>\n<p>In Debian (and Ubuntu, Linux Mint, etc.), if you have src-repositories connected, you can build the installation deb packages:<\/p>\n<p><code>mkdir mc_smb<br \/>\ncd mc_smb<br \/>\napt-get source mc<\/code><\/p>\n<p>Then use any text editor to open the <code>rules<\/code> file in the <code>mc_smb\/mc-4.x.xx\/debian<\/code> folder (where 4.x.xx is the downloaded version number) and lines:<\/p>\n<p><code>\t\t--enable-tests<br \/>\n#\t\t--enable-vfs-smb=yes<\/code><\/p>\n<p>change to:<\/p>\n<p><code>\t\t--enable-tests \\<br \/>\n--enable-vfs-smb=yes<\/code><\/p>\n<p>You can then go to the source directory and build the new packages:<\/p>\n<p><code>cd mc-4.x.xx<br \/>\ndpkg-buildpackage<\/code><\/p>\n<p>After a while the packages will be assembled and be found in the directory above, it can be reinstalled with the command:<\/p>\n<p><code>cd ..<br \/>\nsudo dpkg -i mc-data_4.x.xx_all.deb mc_4.x.xx_arch.deb<\/code><\/p>\n<p>(where 4.x.xx is the build version number and arch is your CPU architecture)<br \/>\nOf course, you could also install the compiled mc package with your usual installer instead.<\/p>\n<p>Addendum:<\/p>\n<p>You can also download the patches and packages of a specific version of mc: <a href=\"https:\/\/github.com\/zlaxy\/mc\">https:\/\/github.com\/zlaxy\/mc<\/a>.<br \/>\nIt, unlike the official branch:<br \/>\n&#8211; there is a scrollbar in the active panels;<br \/>\n&#8211; pressing F3 on a directory counts and displays its size;<br \/>\n&#8211; Shift+F1\/Shisft+F2 or F11\/F12 open the menu of mountpounts with the hotlist (with ability to add network and smb addresses to it);<\/p>\n<p>Here&#8217;s what it looks like:<br \/>\n<a href=\"https:\/\/github.com\/zlaxy\/mc\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1003 aligncenter img-responsive\" src=\"https:\/\/oss-it.su\/wp-content\/uploads\/2017\/02\/mc-1.png\" alt=\"\" width=\"562\" height=\"338\" srcset=\"https:\/\/oss-it.su\/wp-content\/uploads\/2017\/02\/mc-1.png 562w, https:\/\/oss-it.su\/wp-content\/uploads\/2017\/02\/mc-1-300x180.png 300w\" sizes=\"auto, (max-width: 562px) 100vw, 562px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to install MC (Midnight Commander) with Samba support.<\/p>\n","protected":false},"author":1,"featured_media":881,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[9,15],"class_list":["post-883","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-system","tag-network","tag-ubuntu"],"_links":{"self":[{"href":"https:\/\/oss-it.su\/en\/wp-json\/wp\/v2\/posts\/883","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oss-it.su\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/oss-it.su\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/oss-it.su\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oss-it.su\/en\/wp-json\/wp\/v2\/comments?post=883"}],"version-history":[{"count":19,"href":"https:\/\/oss-it.su\/en\/wp-json\/wp\/v2\/posts\/883\/revisions"}],"predecessor-version":[{"id":1103,"href":"https:\/\/oss-it.su\/en\/wp-json\/wp\/v2\/posts\/883\/revisions\/1103"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/oss-it.su\/en\/wp-json\/wp\/v2\/media\/881"}],"wp:attachment":[{"href":"https:\/\/oss-it.su\/en\/wp-json\/wp\/v2\/media?parent=883"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oss-it.su\/en\/wp-json\/wp\/v2\/categories?post=883"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oss-it.su\/en\/wp-json\/wp\/v2\/tags?post=883"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}