mount share cifs folder without sudo












1















I want to mount share folder.
Curren command line:



sudo mount -t cifs -o username=USERNAME,password=PASSWD


Is it have some safe way (without permanent sudo and other). Any others utils?



If this is not possible in general, it will be enough for me to be able to mount only a certain shared folder to a certain place.










share|improve this question























  • You want to run that command without sudo?

    – George Udosen
    Dec 11 '18 at 17:36











  • I want to run ANY command that not require root access and mount cifs with name and password

    – Hait
    Dec 11 '18 at 18:14
















1















I want to mount share folder.
Curren command line:



sudo mount -t cifs -o username=USERNAME,password=PASSWD


Is it have some safe way (without permanent sudo and other). Any others utils?



If this is not possible in general, it will be enough for me to be able to mount only a certain shared folder to a certain place.










share|improve this question























  • You want to run that command without sudo?

    – George Udosen
    Dec 11 '18 at 17:36











  • I want to run ANY command that not require root access and mount cifs with name and password

    – Hait
    Dec 11 '18 at 18:14














1












1








1








I want to mount share folder.
Curren command line:



sudo mount -t cifs -o username=USERNAME,password=PASSWD


Is it have some safe way (without permanent sudo and other). Any others utils?



If this is not possible in general, it will be enough for me to be able to mount only a certain shared folder to a certain place.










share|improve this question














I want to mount share folder.
Curren command line:



sudo mount -t cifs -o username=USERNAME,password=PASSWD


Is it have some safe way (without permanent sudo and other). Any others utils?



If this is not possible in general, it will be enough for me to be able to mount only a certain shared folder to a certain place.







permissions mount cifs






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 11 '18 at 17:26









HaitHait

82




82













  • You want to run that command without sudo?

    – George Udosen
    Dec 11 '18 at 17:36











  • I want to run ANY command that not require root access and mount cifs with name and password

    – Hait
    Dec 11 '18 at 18:14



















  • You want to run that command without sudo?

    – George Udosen
    Dec 11 '18 at 17:36











  • I want to run ANY command that not require root access and mount cifs with name and password

    – Hait
    Dec 11 '18 at 18:14

















You want to run that command without sudo?

– George Udosen
Dec 11 '18 at 17:36





You want to run that command without sudo?

– George Udosen
Dec 11 '18 at 17:36













I want to run ANY command that not require root access and mount cifs with name and password

– Hait
Dec 11 '18 at 18:14





I want to run ANY command that not require root access and mount cifs with name and password

– Hait
Dec 11 '18 at 18:14










1 Answer
1






active

oldest

votes


















2














To be able to mount that folder as a normal user, include the mount options for the cifs folder in the configuration file /etc/fstab, and add the options noauto,user, similar to:



//nas-server/cifsShare /media/user/cifsShare cifs -o username=<username>,noauto,user 0 0


The option noauto will make sure the drive is not mounted during startup, but will nevertheless register all parameters necessary to mount the drive. The option user will allow any user to mount the drive.



With this setup, any user is able to mount the share with the mount command, followed by the path that was specified in fstab where the folder is to be mounted, e.g.



mount /media/user/cifsShare


or followed by the share, as in



mount //nas-server/cifsShare


Easier, probably, will be to mount the share using the file manager (Files in standard Ubuntu 18.04). In standard Files, one mounts a drive by providing the URI, in the form of



smb://server/share



A dialog will pop up to ask login, domain and password. Optionally, these settings can be remembered. You can subsequently make a bookmark for easy one-click access in the future.



This works out of the box in several editions of Ubuntu (stock Ubuntu, but also Kubuntu, Xubuntu, ...) and avoids the need to change system configuration files.






share|improve this answer


























  • I use ubuntu from ssh. GUI is not available for me.

    – Hait
    Dec 11 '18 at 18:12











  • @vanadium, You might want to show a generic fstab entry in your answer with the noauto,user combination so that it is more obvious. Then to mount the share all Hait would have to do is issue a "mount /mountpoint" - without sudo just as you described.

    – Morbius1
    Dec 11 '18 at 18:32











  • Is it right? //<ip_addres>/<resource> /media/<mount_point>/ cifs [user=username>@<domain>],[password=<password>],noauto,user 0 0

    – Hait
    Dec 11 '18 at 18:35













  • As Morbius suggested, I edited the answer to add a generic fstab entry for improving clarity. GUI not available was not clear for the question. It does not harm to leave that part in.

    – vanadium
    Dec 11 '18 at 20:16











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1100114%2fmount-share-cifs-folder-without-sudo%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














To be able to mount that folder as a normal user, include the mount options for the cifs folder in the configuration file /etc/fstab, and add the options noauto,user, similar to:



//nas-server/cifsShare /media/user/cifsShare cifs -o username=<username>,noauto,user 0 0


The option noauto will make sure the drive is not mounted during startup, but will nevertheless register all parameters necessary to mount the drive. The option user will allow any user to mount the drive.



With this setup, any user is able to mount the share with the mount command, followed by the path that was specified in fstab where the folder is to be mounted, e.g.



mount /media/user/cifsShare


or followed by the share, as in



mount //nas-server/cifsShare


Easier, probably, will be to mount the share using the file manager (Files in standard Ubuntu 18.04). In standard Files, one mounts a drive by providing the URI, in the form of



smb://server/share



A dialog will pop up to ask login, domain and password. Optionally, these settings can be remembered. You can subsequently make a bookmark for easy one-click access in the future.



This works out of the box in several editions of Ubuntu (stock Ubuntu, but also Kubuntu, Xubuntu, ...) and avoids the need to change system configuration files.






share|improve this answer


























  • I use ubuntu from ssh. GUI is not available for me.

    – Hait
    Dec 11 '18 at 18:12











  • @vanadium, You might want to show a generic fstab entry in your answer with the noauto,user combination so that it is more obvious. Then to mount the share all Hait would have to do is issue a "mount /mountpoint" - without sudo just as you described.

    – Morbius1
    Dec 11 '18 at 18:32











  • Is it right? //<ip_addres>/<resource> /media/<mount_point>/ cifs [user=username>@<domain>],[password=<password>],noauto,user 0 0

    – Hait
    Dec 11 '18 at 18:35













  • As Morbius suggested, I edited the answer to add a generic fstab entry for improving clarity. GUI not available was not clear for the question. It does not harm to leave that part in.

    – vanadium
    Dec 11 '18 at 20:16
















2














To be able to mount that folder as a normal user, include the mount options for the cifs folder in the configuration file /etc/fstab, and add the options noauto,user, similar to:



//nas-server/cifsShare /media/user/cifsShare cifs -o username=<username>,noauto,user 0 0


The option noauto will make sure the drive is not mounted during startup, but will nevertheless register all parameters necessary to mount the drive. The option user will allow any user to mount the drive.



With this setup, any user is able to mount the share with the mount command, followed by the path that was specified in fstab where the folder is to be mounted, e.g.



mount /media/user/cifsShare


or followed by the share, as in



mount //nas-server/cifsShare


Easier, probably, will be to mount the share using the file manager (Files in standard Ubuntu 18.04). In standard Files, one mounts a drive by providing the URI, in the form of



smb://server/share



A dialog will pop up to ask login, domain and password. Optionally, these settings can be remembered. You can subsequently make a bookmark for easy one-click access in the future.



This works out of the box in several editions of Ubuntu (stock Ubuntu, but also Kubuntu, Xubuntu, ...) and avoids the need to change system configuration files.






share|improve this answer


























  • I use ubuntu from ssh. GUI is not available for me.

    – Hait
    Dec 11 '18 at 18:12











  • @vanadium, You might want to show a generic fstab entry in your answer with the noauto,user combination so that it is more obvious. Then to mount the share all Hait would have to do is issue a "mount /mountpoint" - without sudo just as you described.

    – Morbius1
    Dec 11 '18 at 18:32











  • Is it right? //<ip_addres>/<resource> /media/<mount_point>/ cifs [user=username>@<domain>],[password=<password>],noauto,user 0 0

    – Hait
    Dec 11 '18 at 18:35













  • As Morbius suggested, I edited the answer to add a generic fstab entry for improving clarity. GUI not available was not clear for the question. It does not harm to leave that part in.

    – vanadium
    Dec 11 '18 at 20:16














2












2








2







To be able to mount that folder as a normal user, include the mount options for the cifs folder in the configuration file /etc/fstab, and add the options noauto,user, similar to:



//nas-server/cifsShare /media/user/cifsShare cifs -o username=<username>,noauto,user 0 0


The option noauto will make sure the drive is not mounted during startup, but will nevertheless register all parameters necessary to mount the drive. The option user will allow any user to mount the drive.



With this setup, any user is able to mount the share with the mount command, followed by the path that was specified in fstab where the folder is to be mounted, e.g.



mount /media/user/cifsShare


or followed by the share, as in



mount //nas-server/cifsShare


Easier, probably, will be to mount the share using the file manager (Files in standard Ubuntu 18.04). In standard Files, one mounts a drive by providing the URI, in the form of



smb://server/share



A dialog will pop up to ask login, domain and password. Optionally, these settings can be remembered. You can subsequently make a bookmark for easy one-click access in the future.



This works out of the box in several editions of Ubuntu (stock Ubuntu, but also Kubuntu, Xubuntu, ...) and avoids the need to change system configuration files.






share|improve this answer















To be able to mount that folder as a normal user, include the mount options for the cifs folder in the configuration file /etc/fstab, and add the options noauto,user, similar to:



//nas-server/cifsShare /media/user/cifsShare cifs -o username=<username>,noauto,user 0 0


The option noauto will make sure the drive is not mounted during startup, but will nevertheless register all parameters necessary to mount the drive. The option user will allow any user to mount the drive.



With this setup, any user is able to mount the share with the mount command, followed by the path that was specified in fstab where the folder is to be mounted, e.g.



mount /media/user/cifsShare


or followed by the share, as in



mount //nas-server/cifsShare


Easier, probably, will be to mount the share using the file manager (Files in standard Ubuntu 18.04). In standard Files, one mounts a drive by providing the URI, in the form of



smb://server/share



A dialog will pop up to ask login, domain and password. Optionally, these settings can be remembered. You can subsequently make a bookmark for easy one-click access in the future.



This works out of the box in several editions of Ubuntu (stock Ubuntu, but also Kubuntu, Xubuntu, ...) and avoids the need to change system configuration files.







share|improve this answer














share|improve this answer



share|improve this answer








edited Dec 11 '18 at 20:13

























answered Dec 11 '18 at 18:02









vanadiumvanadium

5,38811229




5,38811229













  • I use ubuntu from ssh. GUI is not available for me.

    – Hait
    Dec 11 '18 at 18:12











  • @vanadium, You might want to show a generic fstab entry in your answer with the noauto,user combination so that it is more obvious. Then to mount the share all Hait would have to do is issue a "mount /mountpoint" - without sudo just as you described.

    – Morbius1
    Dec 11 '18 at 18:32











  • Is it right? //<ip_addres>/<resource> /media/<mount_point>/ cifs [user=username>@<domain>],[password=<password>],noauto,user 0 0

    – Hait
    Dec 11 '18 at 18:35













  • As Morbius suggested, I edited the answer to add a generic fstab entry for improving clarity. GUI not available was not clear for the question. It does not harm to leave that part in.

    – vanadium
    Dec 11 '18 at 20:16



















  • I use ubuntu from ssh. GUI is not available for me.

    – Hait
    Dec 11 '18 at 18:12











  • @vanadium, You might want to show a generic fstab entry in your answer with the noauto,user combination so that it is more obvious. Then to mount the share all Hait would have to do is issue a "mount /mountpoint" - without sudo just as you described.

    – Morbius1
    Dec 11 '18 at 18:32











  • Is it right? //<ip_addres>/<resource> /media/<mount_point>/ cifs [user=username>@<domain>],[password=<password>],noauto,user 0 0

    – Hait
    Dec 11 '18 at 18:35













  • As Morbius suggested, I edited the answer to add a generic fstab entry for improving clarity. GUI not available was not clear for the question. It does not harm to leave that part in.

    – vanadium
    Dec 11 '18 at 20:16

















I use ubuntu from ssh. GUI is not available for me.

– Hait
Dec 11 '18 at 18:12





I use ubuntu from ssh. GUI is not available for me.

– Hait
Dec 11 '18 at 18:12













@vanadium, You might want to show a generic fstab entry in your answer with the noauto,user combination so that it is more obvious. Then to mount the share all Hait would have to do is issue a "mount /mountpoint" - without sudo just as you described.

– Morbius1
Dec 11 '18 at 18:32





@vanadium, You might want to show a generic fstab entry in your answer with the noauto,user combination so that it is more obvious. Then to mount the share all Hait would have to do is issue a "mount /mountpoint" - without sudo just as you described.

– Morbius1
Dec 11 '18 at 18:32













Is it right? //<ip_addres>/<resource> /media/<mount_point>/ cifs [user=username>@<domain>],[password=<password>],noauto,user 0 0

– Hait
Dec 11 '18 at 18:35







Is it right? //<ip_addres>/<resource> /media/<mount_point>/ cifs [user=username>@<domain>],[password=<password>],noauto,user 0 0

– Hait
Dec 11 '18 at 18:35















As Morbius suggested, I edited the answer to add a generic fstab entry for improving clarity. GUI not available was not clear for the question. It does not harm to leave that part in.

– vanadium
Dec 11 '18 at 20:16





As Morbius suggested, I edited the answer to add a generic fstab entry for improving clarity. GUI not available was not clear for the question. It does not harm to leave that part in.

– vanadium
Dec 11 '18 at 20:16


















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1100114%2fmount-share-cifs-folder-without-sudo%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to send String Array data to Server using php in android

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

Is anime1.com a legal site for watching anime?