sshfs to a machine ok but ls fail with Permission denied - HP UX
This is a discussion on sshfs to a machine ok but ls fail with Permission denied - HP UX ; 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@local$ sudo ...
-
sshfs to a machine ok but ls fail with Permission denied
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@local$ sudo sshfs -o idmap=user remote: /home/twong/remote
root@remote's password:
;sshfs successfully.
twong@local$ ls -l /home/twong/remote
ls: /home/twong/remote: Permission denied
root@local#ls -l /home/twong/remote
;...
files in the /root directory of remote can be listed correctly by root
at local.
twong@local$ sudo sshfs -o idmap=user remote:/home/twong /home/twong/
remote
root@remote's password:
twong@local$ ls -l /home/twong/remote
ls: /home/twong/remote: Permission denied
root@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.
-
Re: sshfs to a machine ok but ls fail with Permission denied
TsanChung writes:
> root@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
-
Re: sshfs to a machine ok but ls fail with Permission denied
On Aug 14, 3:01*pm, Maxwell Lol wrote:
> TsanChung writes:
> > root@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 UIDand GID are.
>
> Check the FAQ. It says something about *the options
>
> * * * -o idmap=user -o uid=505 -g gid=505
twong@local$ id twong
uid=500(twong) gid=500(twong) groups=500(twong),101(fuse)
twong@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@local$ ls -l /home/twong/remote
ls: /home/twong/remote: Permission denied
root@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?
-
Re: sshfs to a machine ok but ls fail with Permission denied
On Aug 15, 9:31*am, TsanChung wrote:
> On Aug 14, 3:01*pm, Maxwell Lol wrote:
>
> > TsanChung writes:
> > > root@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@local$ id twong
> uid=500(twong) gid=500(twong) groups=500(twong),101(fuse)
> twong@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@local$ ls -l /home/twong/remote
> ls: /home/twong/remote: Permission denied
>
> root@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@local$ id twong
uid=500(twong) gid=500(twong) groups=500(twong),101(fuse)
twong@local$ sudo sshfs -o idmap=user -o uid=500 -o gid=500 -o
allow_other twong@thorin: /home/twong/thorin
Thanks.