Main Page | Report this Page
 
   
Linux Forum Index  »  Linux Networking  »  sshfs to a machine ok but ls fail with Permission...
Page 1 of 1    
Author Message
TsanChung...
Posted: Thu Aug 14, 2008 5:04 am
Guest
I can ssh to a machine as a non-root user and run the "ls" command.
I can sshfs to the same machine as a non-root user but "ls" fail with
"Permission denied".
Please help to fix this problem.

twong at (no spam) local$ sudo sshfs -o idmap=user remote: /home/twong/remote
root at (no spam) remote's password:
;sshfs successfully.

twong at (no spam) local$ ls -l /home/twong/remote
ls: /home/twong/remote: Permission denied

root at (no spam) local#ls -l /home/twong/remote
;...
files in the /root directory of remote can be listed correctly by root
at local.

twong at (no spam) local$ sudo sshfs -o idmap=user remote:/home/twong /home/twong/
remote
root at (no spam) remote's password:
twong at (no spam) local$ ls -l /home/twong/remote
ls: /home/twong/remote: Permission denied

root at (no spam) local#ls -l /home/twong/remote
;...
drwxrwxr-x 1 505 505 4096 Apr 24 17:39 bin
files in the /home/twong directory of remote can be listed by root at
local but the id is not twong.

The local machine OS is FC6.
The same problem appear in two remote machines.
The first remote OS is RH7.2.
The second remote OS is HP-UX B.11.31 U ia64.
Maxwell Lol...
Posted: Thu Aug 14, 2008 2:01 pm
Guest
TsanChung <tsanchung.wong at (no spam) gmail.com> writes:

Quote:
root at (no spam) local#ls -l /home/twong/remote
;...
drwxrwxr-x 1 505 505 4096 Apr 24 17:39 bin
files in the /home/twong directory of remote can be listed by root at
local but the id is not twong.

I don't know what sshfs is, but use the id command to check what your UID and GID are.


Check the FAQ. It says something about the options

-o idmap=user -o uid=505 -g gid=505
TsanChung...
Posted: Fri Aug 15, 2008 3:31 am
Guest
On Aug 14, 3:01 pm, Maxwell Lol <nos... at (no spam) com.invalid> wrote:
Quote:
TsanChung <tsanchung.w... at (no spam) gmail.com> writes:
root at (no spam) local#ls -l /home/twong/remote
;...
drwxrwxr-x 1 505 505     4096 Apr 24 17:39 bin
files in the /home/twong directory of remote can be listed by root at
local but the id is not twong.

I don't know what sshfs is, but use the id command to check what your UID and GID are.

Check the FAQ. It says something about  the options

      -o idmap=user -o uid=505 -g gid=505

twong at (no spam) local$ id twong
uid=500(twong) gid=500(twong) groups=500(twong),101(fuse)
twong at (no spam) local$ sudo sshfs -o idmap=user -o uid=500 -o gid=500 remote:/
home/twong /home/twong/remote
Password: (must enter root pw of remote, do not accept twong pw of
remote)

twong at (no spam) local$ ls -l /home/twong/remote
ls: /home/twong/remote: Permission denied

root at (no spam) local# ls -l /home/twong/remote
total 36
drwxr-xr-x 1 twong twong 96 Aug 12 11:42 cert
Files in the /home/twong directory of remote can be listed by root but
not by twong at local.
How to make twong to access the /home/twong directory of remote with
sshfs?
TsanChung...
Posted: Fri Aug 15, 2008 4:37 am
Guest
On Aug 15, 9:31 am, TsanChung <tsanchung.w... at (no spam) gmail.com> wrote:
Quote:
On Aug 14, 3:01 pm, Maxwell Lol <nos... at (no spam) com.invalid> wrote:

TsanChung <tsanchung.w... at (no spam) gmail.com> writes:
root at (no spam) local#ls -l /home/twong/remote
;...
drwxrwxr-x 1 505 505     4096 Apr 24 17:39 bin
files in the /home/twong directory of remote can be listed by root at
local but the id is not twong.

I don't know what sshfs is, but use the id command to check what your UID and GID are.

Check the FAQ. It says something about  the options

      -o idmap=user -o uid=505 -g gid=505

twong at (no spam) local$ id twong
uid=500(twong) gid=500(twong) groups=500(twong),101(fuse)
twong at (no spam) local$ sudo sshfs -o idmap=user -o uid=500 -o gid=500 remote:/
home/twong /home/twong/remote
Password:  (must enter root pw of remote, do not accept twong pw of
remote)

twong at (no spam) local$ ls -l /home/twong/remote
ls: /home/twong/remote: Permission denied

root at (no spam) local# ls -l /home/twong/remote
total 36
drwxr-xr-x 1 twong twong   96 Aug 12 11:42 cert
Files in the /home/twong directory of remote can be listed by root but
not by twong at local.
How to make twong to access the /home/twong directory of remote with
sshfs?

Problem is solved as follows.
twong at (no spam) local$ id twong
uid=500(twong) gid=500(twong) groups=500(twong),101(fuse)

twong at (no spam) local$ sudo sshfs -o idmap=user -o uid=500 -o gid=500 -o
allow_other twong at (no spam) thorin: /home/twong/thorin

Thanks.
 
Page 1 of 1       All times are GMT - 5 Hours
The time now is Sat Nov 22, 2008 12:43 pm