Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have just installed SAMBA in a Debian box. The only thing I have done has been edit /etc/samba/smb.conf and changed the workgroup so that it matched witch my Windows box.
Then I restarted the smbd service and tried to browse "Other locations" with the gnome File Explorer. It doesn't even show the windows machine.
FYI smbclient is not installed by default anymore and is part of the samba-common package. apt-get will resolve all dependencies and automatically install everything.
apt-get install smbclient (as root via the su command)
I'm running windows 7 ultimate x64, and I have created the share.
I also realized about the "smbclient" does not come by default. What a pain in the ass until I found out...
If I run
Code:
smbclient -L <winhost> -U <username>
it prompts for the Windows username and it displays the shares!!
How can I connect to a share (mount it ) permanently?
In the file browser you can create a bookmark to the share. From the pull down menu File -> Connect to Server. Select "Windows Shares" for type and then enter in all the information. This is a virtual file system that is available within the desktop although it should be also mounted in the traditional manner but the exact location tends to change with gnome versions. This is probably the easiest method.
You can mount it from /etc/fstab. There are several options and if the Windows Box is not always on I might suggest using autofs or systemds automount. The share will only mount when you try to access the Windows box and the system will not try to mount if the the Windows computer is not running. The Windows drive will be accessible like an external drive.
In the file browser you can create a bookmark to the share. From the pull down menu File -> Connect to Server. Select "Windows Shares" for type and then enter in all the information. This is a virtual file system that is available within the desktop although it should be also mounted in the traditional manner but the exact location tends to change with gnome versions. This is probably the easiest method.
You can mount it from /etc/fstab. There are several options and if the Windows Box is not always on I might suggest using autofs or systemds automount. The share will only mount when you try to access the Windows box and the system will not try to mount if the the Windows computer is not running. The Windows drive will be accessible like an external drive.
You will want to run something like the following:
Code:
mount -t cifs -o credentials=/root/.cifscredential,uid=1002,gid=1002 //winhost/Public /mnt/WinPublic/
Where uid and gid are the uid and gid (or username and group name) of the Linux user/group you want to be the "owner" of the files. The credentials variable is a file whose contents are:
Code:
username=winuser
password=plaintextpw
With an additional definition for domain, if required.
If you are fine with it, you could omit the password, and running the mount command will prompt you and mask the entered value with asterisks.
I cannot test this right now, but I assume you could also add to the options field the value "noauto" so it does not try to mount on boot. If you're working on a system that is not always on the same network as the cifs server, try the "noauto" flag. But, regardless of the "noauto," you could then just run mount /mnt/WinPublic and it'll prompt for pw if not defined, and then mount it for you!
Last edited by bgstack15; 08-03-2018 at 08:10 AM.
Reason: formatting
I have been able to do it both ways. In the way Linux -> Windows I tried with smbmount, as several webs explain. However, I don't have that command neither can download it via the repositories.
The I tried with mount -t smbfs, but it didn't recognize the filetype.
If I issued apt-get install smbfs, the result was:
Code:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package smbfs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
cifs-utils
I wanted to do it via samba packages, but it gave me no choice. Once I installed cifs-utils, the proper command worked like this:
Code:
mount -t cifs //windows_host/folder /mount/point/ -o username=uname,uid=uname,gid=uname
Thanks for your help! And I hope this solution helps other people with similar issues.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.