{"id":387,"date":"2020-08-18T19:23:47","date_gmt":"2020-08-18T20:23:47","guid":{"rendered":"http:\/\/www.linux-tutorial.info\/?page_id=77"},"modified":"2020-08-22T19:26:19","modified_gmt":"2020-08-22T20:26:19","slug":"this-is-the-page-title-toplevel-220","status":"publish","type":"page","link":"http:\/\/www.linux-tutorial.info\/?page_id=387","title":{"rendered":"Sharing Files"},"content":{"rendered":"\n<title>Sharing Files<\/title>\n<p>\nBeing able to switch back and forth between Linux and Windows or having a\nGUI that looks similar to Windows is still not enough. As I mentioned, if\nyour data is on an <glossary>NTFS<\/glossary> <glossary>partition<\/glossary>\non the local machine, you are pretty much\nstuck with just reading the data. However, if you data is sitting on a NT\nserver you can access it with no problem.<\/p>\n<p>\nOne of Linux&#8217;s strengths is Samba, which provides file and print services\nusing the Session Message Block (SMB) <glossary>protocol<\/glossary>\n(also called the Common Internet Filesystem-CIFS), which is the same <glossary>protocol<\/glossary> Windows machines use.\nWith Samba, Linux machines can provide the file and print services to any\nmachine that supports <glossary>SMB<\/glossary>,\nincluding other Linux machines. In fact, at work\nwe use <glossary>SMB<\/glossary>\nexclusively to access all of file resources, rather than having to\nconfigure <glossary>NFS<\/glossary>\nas well. That means that no matter what operating system\nsomeone is working on, they still have access to the same resources (without\nany extra administrative effort).<\/p>\n<p>\nSo, if Linux machines can access resources on other Linux machines using\nSMB, why can&#8217;t they access resources on a Windows machine? The answer is: they\ncan.<\/p>\n<p>\nSamba actually provides two mechanisms to access resources. The first is\nsmbclient, which provides a functionality similar to <glossary>ftp<\/glossary>.\nThat is, you can copy files back and forth, but do not have the level of\ninteractivity that you do when you <glossary>mount<\/glossary>\nthe <glossary>filesystem<\/glossary>. <\/p>\n<p>\nTo solve this problem, Samba also provides smbmount. As it&#8217;s name implies\nsmbmount is used to <glossary>mount<\/glossary>\nfilesystems being shared using <glossary>SMB<\/glossary>, and has a syntax\nsimilar to the tradition Linux <glossary>mount<\/glossary>\ncommand:\n<\/p>\n<p>\n<commandexample command=\"smbmount\">smbmount \/\/server\/service \/mountpoint<\/commandexample>\n<p>\nNote that the <command>smbmount<\/command> command is actually a front end to the smbmnt program.\nLike <glossary>NFS<\/glossary>,\nsmbmount has a number of different options which control not only\nhow the filesystems are mounted, as well as how the <glossary>client<\/glossary>\npresents itself to\nthe server. For example, you can define the name of your computer, the username\nused to connect, and so forth. You can also use the -c option\nto  smbmount to pass options directly to the smbmnt command, such as defining\nwhich <glossary>UID<\/glossary>\nand <glossary>GID<\/glossary>\nto assign to the files on the mounted <glossary>filesystem<\/glossary>.\n<\/p>\n<p>\nLet&#8217;s look at an example. Assume that you have a share called Data sitting on\nthe server jupiter. There is a user on that machine named jimmo, who has been\ngiven access to the share. To connect we might issue a command like this:\n<\/p>\n<p>\n<commandexample command=\"smbmount\">smbmount \/\/jupiter\/Data \/mnt\/Data -U jimmo <\/commandexample>\n<\/p>\n<p>\nYou are then prompted to input the appropriate password. By using the -N\noption, you can tell smbmount not to prompt for a password.\n<\/p>\n<p>\nOne thing to note is that the smbmount command varies between the various\ndistributions. For example, on SuSE Linux 6.2  the  above syntax mounts the\nshare as a normal <glossary>filesystem<\/glossary>.\nHowever, the same syntax on Red Hat 6.0 behaves like the old smbclient.\n<\/p>\n<p>\nFortunately in all likelihood you will be able to use the standard <glossary>mount<\/glossary>\ncommand to access <glossary>SMB<\/glossary>\nfilesystems. Although not configured by default, most current distributions\ninclude the smbfs <glossary>filesystem<\/glossary>\ndriver, which allows you to treat <glossary>SMB<\/glossary>\nfilesystems basically like any\nother <glossary>filesystem<\/glossary>.  The syntax to <glossary>mount<\/glossary>\nthe share mentioned previously  would be:\n<\/p>\n<p>\n<commandexample command=\"mount\">mount -t smbfs \/\/jupiter\/data \/mnt\/Data<\/commandexample>\n<p>\nNote that this syntax only works if the share is set up as public, because you typically don&#8217;t need a password.\n<\/p>\n<p>\nWe go into detail on configuring SAMBA in <tutorial id=154>another section<\/tutorial>.\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sharing Files Being able to switch back and forth between Linux and Windows or having a GUI that looks similar to Windows is still not enough. As I mentioned, if your data is on an NTFS partition on the local &hellip; <a href=\"http:\/\/www.linux-tutorial.info\/?page_id=387\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-387","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/pages\/387","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=387"}],"version-history":[{"count":1,"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/pages\/387\/revisions"}],"predecessor-version":[{"id":699,"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/pages\/387\/revisions\/699"}],"wp:attachment":[{"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=387"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}