LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-13-2015, 08:59 AM   #1
Lop3
Member
 
Registered: Aug 2013
Posts: 48

Rep: Reputation: Disabled
Question How to use SSHFS where UID===UID (same as NFS)?


Goal
I want to mount my server root at /mnt/server
Root should be able to edit files
bob (uid1000 on both sides) should be able to edit files.
root should be root
bob should be bob. No messing with UIDs.

=============================

Bob mounts the FS:
sshfs root@myserver:/ /mnt/server -o default_permissions,idmap=none

------------------------

This does not achieve the above goal.
I've also tried allow_other and allow_root options.
For some reason these options are mutually exclusive.

--------------------
No combination of options resulted in bob being able to touch a file on the server, and have it owned by bob.
It seems bob needs to connect to the server as bob@myserver mounted as /mnt/server-bob
Then root needs to connect to root@myserver and mount at /mnt/server-root

This seems a bit silly?

If I want to edit files as john (uid1001) I need to make another ssh account for john, and have john connect at john@myserver and mount at /mnt/server-john

The only alternative I can think of is NFS over VPN?

Last edited by Lop3; 11-14-2015 at 02:03 AM.
 
Old 11-13-2015, 09:05 AM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
on my pc root login via ssh is disabled because its stupid. perhaps your server doesnt allow it either ?

edit: i think i am misunderstanding something since it is implied above that you are able to ssh into the server as root (even though it is stated that this does not work).

Last edited by schneidz; 11-13-2015 at 09:09 AM.
 
Old 11-14-2015, 02:06 AM   #3
Lop3
Member
 
Registered: Aug 2013
Posts: 48

Original Poster
Rep: Reputation: Disabled
When i said that the command does not work, I meant it does not achieve my stated goal. (I've edited the text to be more explicit)

The ssh server is not a PC, it's a server. root access is required for remote admin.
 
Old 11-14-2015, 05:21 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
It is a limitation. Per the FAQs

Quote:
Mounting as root

Generally it's not possible to use an sshfs mount as a "real" filesystem shared between multiple users. Some of this functionality can be enabled with the -o allow_other and -o default_permissions options, but files will not be created with the correct ownership, etc...
http://sourceforge.net/p/fuse/wiki/SshfsFaq/

Basically, sshfs makes the sftp protocol look like a mount filesystem.
 
1 members found this post helpful.
Old 11-14-2015, 08:13 AM   #5
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
Quote:
Originally Posted by Lop3 View Post
When i said that the command does not work, I meant it does not achieve my stated goal. (I've edited the text to be more explicit)
thanks for the correction.
Quote:
Originally Posted by Lop3 View Post
The ssh server is not a PC, it's a server.
tomato/tomato.
Quote:
Originally Posted by Lop3 View Post
root access is required for remote admin.
i think in general the best practice would be to login as normal user and sudo when necessary.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the difference between Real UID and Effective UID in terms of file attributes techie_san778 Linux - Server 4 05-11-2013 12:20 AM
Real uid and effective uid palisetty_suman Linux - Newbie 2 02-15-2009 12:59 PM
Changing the UID of a Physical Volume to a specific UID jambraun Linux - Newbie 2 02-09-2006 02:34 PM
FREEBSD5.3 platform: PHP setcookie() successful, but $uid = $_COOKIE['uid']; fail tclwp Programming 1 03-30-2005 08:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration