Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am connecting to a remote server over SSH but am running into a permissions issue.

My remote account is thelq and primarily part of the group thelq. I'm also part of the generic group users. Another remote account called game is primarily part of the group users. On the remote server I can freely view and edit all of game's files. However on the local server I'm apparently not part of the users group. Strangely explicitly specifying the users group for the gid option still doesn't allow me access to the users group

Example of what I tried in command line:

[thelq@quackwall ~]$ sshfs -o idmap=user -o uid=1000 -o gid=1000 -o allow_other -o default_permissions quackgame:/home game-home       
thelq@quackgame's password:
[thelq@quackwall ~]$ echo something >> game-home/game/INIT-SETUP
bash: game-game/game/INIT-SETUP: Permission denied

I'm confused on what else to do as Linux permissions are not my strong point. I was thinking that longing in as me on the remote machine would allow me access to everything the groups says I can but apparently not.

Any suggestions?


As per @penguin359's request

[thelq@quackwall ~]$ ls -ld game-home
drwxr-xr-x 2 thelq allusers 4096 Apr  5 19:06 game-home
[thelq@quackwall ~]$ sshfs quackgame:/home game-home
thelq@quackgame's password:
[thelq@quackwall ~]$ ls -ld game-home
drwxr-xr-x 1 root root 4096 Jan  5 18:20 game-home
[thelq@quackwall ~]$ ssh quackgame id
thelq@quackgame's password:
uid=1000(thelq) gid=1000(thelq) groups=1000(thelq),4(adm),20(dialout),24(cdrom),46(plugdev),100(users),107(sambashare),109(lpadmin),110(admin)
[thelq@quackwall ~]$ ssh quackgame ls -ld /home/game
thelq@quackgame's password:
drwxr-xr-x 11 game users 4096 2011-04-11 21:59 /home/game
share|improve this question

2 Answers 2

up vote 2 down vote accepted

According to your output from ssh quackgame ls -ld /home/game, /home/game is only writable by the file owner, game, and not by the users group. Try running chmod g+w /home/game on quackgame and see if it works.

share|improve this answer
    
Holy crap, I can't believe I missed that. Really sorry! Thanks for the help –  TheLQ Apr 12 '11 at 21:03
    
Permissions in UNIX/Linux aren't really that complicated, but things like sshfs make it more confusing. sshfs is more of a single user filesystem because it logs in to the remote server as a specific user and all accesses are seen as that user. It doesn't matter who on the client-side accesses it. Those settings like uid, gid, etc. are used to affect how it appears on the client side, but don't affect server-side permission which is what this was. Another small note, the idmap option affects how the uid shows up on the client side, but can be misleading as the actual uids may be different. –  penguin359 Apr 12 '11 at 21:58

The idmap option does not affect permissions, it simply affects shows up in stat() for a file's owner. Also, the uid and gid options only affect the local-side of permissions, who owns the connection effectively. The default_permissions option turns on permission checking on the local side which is probably not what you want. Permissions on the remote-side are simply decided by the username used to connect, thelq in this case. Try something simpler like sshfs -o idmap=user quackgame:/home game-home and see if it works.

share|improve this answer
    
This started very simple but quickly got complex as I just layered options on. I went ahead anyway and tested your command again but I still get access denied. –  TheLQ Apr 11 '11 at 23:51
    
Also, try ssh quackgame:/home game-home Can you post the output of ls -ld game-home, ssh quackgame id, and ssh quackgame ls -ld /home/game –  penguin359 Apr 12 '11 at 1:00
    
Posted output in edit. Strange how the folder is owned by root when mounting the folder –  TheLQ Apr 12 '11 at 2:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.