LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   automating mounting of windows SMB shares (https://www.linuxquestions.org/questions/linux-networking-3/automating-mounting-of-windows-smb-shares-432469/)

Murdock1979 04-06-2006 05:35 PM

automating mounting of windows SMB shares
 
Hello!

I am developing a shell script that automatically searches and mounts Samba and Windows SMB shares. You give your username and password and the program searches all available shares and mounts them in specified directory.

The program is called SambaLaunch and can be downloaded from http://smblaunch.blogspot.com/

Would you use this program and like to see this program further developed?

Thanks,
Murdock

david_ross 04-07-2006 12:06 PM

This seems like an interesting idea. A couple of things to think about on the security side though.

It would be much better to use a secured (ie chmod 400) credentials file rather than passing the login details on the command line where they can easily be ready by any other user on the system.

It is also worth noting that if someone adds a rouge machine to your network and everyone runs this script then it would be quite easy to log the usernames and passwords of the computers attempting to connect. Using a trusted hosts list would help a little in this regard.

On the programming side it would be better to append the local pid to your temporary files incase the proccess is run twice and also check the exit codes of the main applications being run.

Murdock1979 04-08-2006 12:46 PM

Thank you david ross for all of your input. The points you made are very helpful. The current script is usuable but it is far from tuned-up and polished off and is intended for future iterations. I will try to implement them as time becomes available.

I didn't understand what you meant that it should "also check the exit codes of the main applications being run"?

I'll keep you updated,
Murdock

Penguin of Wonder 04-17-2006 12:03 PM

I don't use Samba... not yet anyway, but I think it would be great!

ARC1450 04-17-2006 01:42 PM

Unfortunately, you only had one option for "No" (No, I wouldn't use it, as automounting is bad IMHO), but I think it's a great idea and should be continued to be developed.

I would use it, though, if it had the option to ask me what to mount, that would be a program that I would definitely think about using.

Penguin of Wonder 04-17-2006 01:46 PM

I don't think automounting is bad unless it poses some sort of security risk like automounting your boot paritation and leaving it mounted.

Murdock1979 04-17-2006 03:20 PM

Thank you Arc and Penguin for the feedback.

If you want a lot of control with Samba mounts, it would be best to use LinNeighborhood. The purpose of this program is to mount shares without the all the fuss and details that LinNeighborhood requires, like the location of the mount and where to mount it.

Smblaunch finds it main usefulness in medium to large organizations, where one simply does not have the time to give attention to each computer as much as in smaller networks. However, small networks, especially ones being run by newbies, would also find this utility useful.

The utility is still in its early versions, and we are in the midst of development. Any mounting and storage device manipulating has its risks, and we are working on closing as much of them as possible. Future versions will probably have a blockhost file which will block specified hosts. The configuration file will also be located in a chmod 400 private file.

Thank you again,
Murdock

ARC1450 04-17-2006 03:22 PM

Quote:

Originally Posted by Penguin of Wonder
I don't think automounting is bad unless it poses some sort of security risk like automounting your boot paritation and leaving it mounted.

Things automatically happening is one reason I got away from Windows. If it's a security risk or not, I don't want something being done completely automatically. I'm all for it going and discovering the shares, then asking. But leaving shares connected that are unused is something I dislike doing. There's a lot of behind-the-scenes stuff when dealing with the Windows/Samba shares, and frankly, simply being hooked up to a Windows machine without my knowledge is something that gives me the chills.

And IMHO, anytime you have something mounted, it's a security risk because there's two-way communication there. As another person said, all it takes is one share with a bad RPC command auto-executing on it, and the consequences could be really, really bad for you.


All times are GMT -5. The time now is 08:15 PM.