Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
10-28-2014, 11:38 AM
|
#1
|
Member
Registered: Jul 2008
Location: Tehran
Posts: 441
Rep:
|
How can I mount a remote Location in Fstab with RW permission?
Hello All.
I use Debian 7 x64 and want to mount a Windows partition in fstab with RW permission. I use below command in fstab but it is Read-Only !!!!
//192.168.1.1/D$ /mnt/f cifs username=test,dom=Mydomain,password=XxX,rw 0 0
it show me :
mount: block device //192.168.1.1/D$ is write-protected, mounting read-only
How can I solve it?
|
|
|
10-28-2014, 11:49 AM
|
#2
|
Member
Registered: Aug 2014
Location: Leeds, England
Distribution: Slackware x86 64 version 15.0
Posts: 127
Rep:
|
I have not done this myself, but I would be reaching for Samba and/or NFS to do so.
|
|
|
10-28-2014, 12:02 PM
|
#3
|
LQ Guru
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573
|
Quote:
Originally Posted by DarrenDrapkin
I have not done this myself, but I would be reaching for Samba and/or NFS to do so.
|
Samba is for sharing a Linux filesystem with a Windows client
NFS is for sharing a Linux filesystem with a Linux client
Neither are what the OP is looking for. He wants CIFS, which is what he's using.
OP - my guess is the user and password you've provided for the share do not have write permissions on the Windows box. Remember, this should be the username and password for a Windows user who has write permission on the specified drive, not your Linux user/pass.
You should also make sure the mount point "/mnt/f" has the proper permissions. And it would be a good idea to put your user/pass in a special file that's only accessible by root and is referenced using the credentials argument in fstab, otherwise your Windows user/pass will be available in plain-text to literally anybody who logs into your Linux system.
FWIW - here is the fstab entry on my machine for a Windows mount with read permission for everybody and read/write permission for all members of the "source" group.
Code:
//192.168.1.118/shared /home/shared cifs auto,gid=source,file_mode=0664,dir_mode=0775,iocharset=iso8859-15,credentials=/etc/sambapasswords 0 0
and the /etc/sambapasswords file:
Code:
# ls -l /etc/sambapasswords
-rw------- 1 root root 42 Aug 5 2011 /etc/sambapasswords
# cat /etc/sambapasswords
username = myuser
password = mypass
Last edited by suicidaleggroll; 10-28-2014 at 12:04 PM.
|
|
1 members found this post helpful.
|
10-29-2014, 08:58 AM
|
#4
|
Member
Registered: Jul 2008
Location: Tehran
Posts: 441
Original Poster
Rep:
|
Thank you.
Make a File for username and Password is a good idea and I will do it.
About the username and password I must tell you that this Username is admin and have full permission. When I use "Connect to server" and select "Windows share" in "Type" part and use this Username, I have full permission.
What is your Idea? my "/mnt/f" directory have :
"drwxr-xr-x 1 root root 12288 Sep 20 17:10 f"
????
|
|
|
10-29-2014, 09:49 AM
|
#5
|
LQ Guru
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573
|
Try changing the group of the mount point to some group your main users are a part of (eg: users) and give the group write permission, and in the mount set the gid, file_mode, and dir_mode to give the group read/write permission.
|
|
|
11-01-2014, 05:27 AM
|
#6
|
Member
Registered: Jul 2008
Location: Tehran
Posts: 441
Original Poster
Rep:
|
Hi.
I change the directory owner via below command :
chown -R mohsen:mohsen f/
and ls -l show :
drwxr-xr-x 2 mohsen mohsen 4096 Aug 9 21:29 f
but I can't create file and directories!!! Excuse me, I created "f" directory under the "/mnt" , Must I change "mnt" directory owner too?
about "/etc/sambapasswords" , I have not this file, Can I create it manually?
Thanks.
|
|
|
11-05-2014, 07:02 AM
|
#7
|
Member
Registered: Jul 2008
Location: Tehran
Posts: 441
Original Poster
Rep:
|
Any Idea?
|
|
|
11-05-2014, 07:05 PM
|
#8
|
LQ Guru
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573
|
Yes create the /etc/sambapasswords file, you can name it whatever you want, doesn't matter.
Did you add the gid, file_mode, and dir_mode options from my example? That mounts it with a specific group and lets you modify the permissions appropriately so members of that group can have write access.
|
|
|
11-10-2014, 05:36 AM
|
#9
|
Member
Registered: Jul 2008
Location: Tehran
Posts: 441
Original Poster
Rep:
|
Problem Solved with add "uid=1000"
|
|
|
All times are GMT -5. The time now is 06:45 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|