Looking for an effective way to quickly access SMB shares from Fedora
-
@IRJ said in Looking for an effective way to quickly access SMB shares from Fedora:
@Dashrender said in Looking for an effective way to quickly access SMB shares from Fedora:
I don't know schit about using Linux - but isn't there a way to automount partitions? wouldn't you use that same mechanism to mount SMB shares at boot? or a logon script for your user account that does it when you log in?
I dont want automount because I jump networks alot. One thing I have noticed is that if you dont properly disconnect shares, it can cause longer load times in File Manger. I also dont use SMB shares but a few times throughout the day. I would rather just bring them up on demand.
So why not script the shares for any given site, and when you're on-site and need those shares you simply run the bash script.
@travisdh1 posted something that would work well for that.
-
@DustinB3403 said in Looking for an effective way to quickly access SMB shares from Fedora:
@IRJ said in Looking for an effective way to quickly access SMB shares from Fedora:
@Dashrender said in Looking for an effective way to quickly access SMB shares from Fedora:
I don't know schit about using Linux - but isn't there a way to automount partitions? wouldn't you use that same mechanism to mount SMB shares at boot? or a logon script for your user account that does it when you log in?
I dont want automount because I jump networks alot. One thing I have noticed is that if you dont properly disconnect shares, it can cause longer load times in File Manger. I also dont use SMB shares but a few times throughout the day. I would rather just bring them up on demand.
So why not script the shares for any given site, and when you're on-site and need those shares you simply run the bash script.
@travisdh1 posted something that would work well for that.
Yep. I like his idea. I was just replying in order
-
@IRJ said in Looking for an effective way to quickly access SMB shares from Fedora:
@DustinB3403 said in Looking for an effective way to quickly access SMB shares from Fedora:
@IRJ said in Looking for an effective way to quickly access SMB shares from Fedora:
@Dashrender said in Looking for an effective way to quickly access SMB shares from Fedora:
I don't know schit about using Linux - but isn't there a way to automount partitions? wouldn't you use that same mechanism to mount SMB shares at boot? or a logon script for your user account that does it when you log in?
I dont want automount because I jump networks alot. One thing I have noticed is that if you dont properly disconnect shares, it can cause longer load times in File Manger. I also dont use SMB shares but a few times throughout the day. I would rather just bring them up on demand.
So why not script the shares for any given site, and when you're on-site and need those shares you simply run the bash script.
@travisdh1 posted something that would work well for that.
Yep. I like his idea. I was just replying in order
So was I, you just rapid fire responded.
-
Put your username and password in a text file in your hidden
/home/user/.config
folder.
Create this file/home/user/.config/smb_creds
With this contentusername=SMBUser password=SMBPassword
Create a folder to mount the share to
mkdir /home/user/mountfolder
Put this line in
/etc/fstab
//192.168.1.1/share /home/user/mountfolder cifs defaults,credentials=/home/user/.config/smb_creds,users,auto,uid=1000,gid=1000 0 0
Reboot.
had to google the
fstab
bit couldn't remember the syntax, so might be off, but should be close. -
@JaredBusch said in Looking for an effective way to quickly access SMB shares from Fedora:
Put your username and password in a text file in your hidden
/home/user/.config
folder.
Create this file/home/user/.config/smb_creds
With this contentusername=SMBUser password=SMBPassword
Can I store domain there as well?
-
@JaredBusch Isn't that automounting?
-
@IRJ said in Looking for an effective way to quickly access SMB shares from Fedora:
@JaredBusch said in Looking for an effective way to quickly access SMB shares from Fedora:
Put your username and password in a text file in your hidden
/home/user/.config
folder.
Create this file/home/user/.config/smb_creds
With this contentusername=SMBUser password=SMBPassword
Can I store domain there as well?
You'd just enter the username as
domain@user
iirc -
@DustinB3403 said in Looking for an effective way to quickly access SMB shares from Fedora:
@JaredBusch Isn't that automounting?
Yes, but I was typign all that when from before @travisdh1's reply.
-
@DustinB3403 said in Looking for an effective way to quickly access SMB shares from Fedora:
@JaredBusch Isn't that automounting?
I really like the idea of cred file. That would make things easy.
Instead of autoconfig, I would like a script that I could use for connecting that breaks connection at reboot
-
@DustinB3403 said in Looking for an effective way to quickly access SMB shares from Fedora:
@IRJ said in Looking for an effective way to quickly access SMB shares from Fedora:
@JaredBusch said in Looking for an effective way to quickly access SMB shares from Fedora:
Put your username and password in a text file in your hidden
/home/user/.config
folder.
Create this file/home/user/.config/smb_creds
With this contentusername=SMBUser password=SMBPassword
Can I store domain there as well?
You'd just enter the username as
domain@user
iircok. That is easy enough.
-
@IRJ said in Looking for an effective way to quickly access SMB shares from Fedora:
@DustinB3403 said in Looking for an effective way to quickly access SMB shares from Fedora:
@IRJ said in Looking for an effective way to quickly access SMB shares from Fedora:
@JaredBusch said in Looking for an effective way to quickly access SMB shares from Fedora:
Put your username and password in a text file in your hidden
/home/user/.config
folder.
Create this file/home/user/.config/smb_creds
With this contentusername=SMBUser password=SMBPassword
Can I store domain there as well?
You'd just enter the username as
domain@user
iircok. That is easy enough.
I'd make another script to unmount the shares when your done with them as well.
#!/bin/bash umount /mount/point
-
@IRJ said in Looking for an effective way to quickly access SMB shares from Fedora:
@DustinB3403 said in Looking for an effective way to quickly access SMB shares from Fedora:
@JaredBusch Isn't that automounting?
I really like the idea of cred file. That would make things easy.
Instead of autoconfig, I would like a script that I could use for connecting that breaks connection at reboot
You still should dismount the share (in a normal circumstance), but at least the approach @travisdh1 posted won't automount.
-
@IRJ said in Looking for an effective way to quickly access SMB shares from Fedora:
@DustinB3403 said in Looking for an effective way to quickly access SMB shares from Fedora:
@JaredBusch Isn't that automounting?
I really like the idea of cred file. That would make things easy.
Instead of autoconfig, I would like a script that I could use for connecting that breaks connection at reboot
Combine the two suggestions.
Don't use fstab, use the mount. But don't prompt for the user/pass, read it from a config file.
-
@travisdh1 said in Looking for an effective way to quickly access SMB shares from Fedora:
@IRJ said in Looking for an effective way to quickly access SMB shares from Fedora:
@DustinB3403 said in Looking for an effective way to quickly access SMB shares from Fedora:
@IRJ said in Looking for an effective way to quickly access SMB shares from Fedora:
@JaredBusch said in Looking for an effective way to quickly access SMB shares from Fedora:
Put your username and password in a text file in your hidden
/home/user/.config
folder.
Create this file/home/user/.config/smb_creds
With this contentusername=SMBUser password=SMBPassword
Can I store domain there as well?
You'd just enter the username as
domain@user
iircok. That is easy enough.
I'd make another script to unmount the shares when your done with them as well.
#!/bin/bash unmount /mount/point
Might make that one big general dismount for all of the shares you might even use. Rather than a script per SMB server.
-
@DustinB3403 said in Looking for an effective way to quickly access SMB shares from Fedora:
@IRJ said in Looking for an effective way to quickly access SMB shares from Fedora:
@JaredBusch said in Looking for an effective way to quickly access SMB shares from Fedora:
Put your username and password in a text file in your hidden
/home/user/.config
folder.
Create this file/home/user/.config/smb_creds
With this contentusername=SMBUser password=SMBPassword
Can I store domain there as well?
You'd just enter the username as
domain@user
iircor domain\username depending on what type of domain you're connecting to.
-
@DustinB3403 said in Looking for an effective way to quickly access SMB shares from Fedora:
@travisdh1 said in Looking for an effective way to quickly access SMB shares from Fedora:
@IRJ said in Looking for an effective way to quickly access SMB shares from Fedora:
@DustinB3403 said in Looking for an effective way to quickly access SMB shares from Fedora:
@IRJ said in Looking for an effective way to quickly access SMB shares from Fedora:
@JaredBusch said in Looking for an effective way to quickly access SMB shares from Fedora:
Put your username and password in a text file in your hidden
/home/user/.config
folder.
Create this file/home/user/.config/smb_creds
With this contentusername=SMBUser password=SMBPassword
Can I store domain there as well?
You'd just enter the username as
domain@user
iircok. That is easy enough.
I'd make another script to unmount the shares when your done with them as well.
#!/bin/bash unmount /mount/point
Might make that one big general dismount for all of the shares you might even use. Rather than a script per SMB server.
I don't like unmounting multiple things with a single command. I've been burned by unmounting important things in the past.
-
On a side question, how do you guys deal with password changes and SMB shares that get mounted like this? Seems like it would be a pain in the rear to have to go and constantly update several files with new passwords every 90 days or so.
-
@DustinB3403 said in Looking for an effective way to quickly access SMB shares from Fedora:
On a side question, how do you guys deal with password changes and SMB shares that get mounted like this? Seems like it would be a pain in the rear to have to go and constantly update several files with new passwords every 90 days or so.
I know of no one who changes domain passwords that frequently - thank the maker. EHR passwords - that's another story.
-
@Dashrender said in Looking for an effective way to quickly access SMB shares from Fedora:
@DustinB3403 said in Looking for an effective way to quickly access SMB shares from Fedora:
On a side question, how do you guys deal with password changes and SMB shares that get mounted like this? Seems like it would be a pain in the rear to have to go and constantly update several files with new passwords every 90 days or so.
I know of no one who changes domain passwords that frequently - thank the maker. EHR passwords - that's another story.
You know me
-
@DustinB3403 said in Looking for an effective way to quickly access SMB shares from Fedora:
On a side question, how do you guys deal with password changes and SMB shares that get mounted like this? Seems like it would be a pain in the rear to have to go and constantly update several files with new passwords every 90 days or so.
That's why I suggested prompting for the password in that sample script.