* [gentoo-user] creating ssh account without directory browsing
@ 2010-08-22 8:36 Tamer Higazi
2010-08-22 9:27 ` Alex Schuster
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Tamer Higazi @ 2010-08-22 8:36 UTC (permalink / raw
To: gentoo-user
Hi people!
For a project I need to create ssh accounts (based on shared keys) who
would be loged in a specific directory. They should only be able to
login in the desired directory, but not be able for outside browsing.
for example:
/work/
but not / or any other scope.
How would you guys accomplish that?!
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-user] creating ssh account without directory browsing
2010-08-22 8:36 [gentoo-user] creating ssh account without directory browsing Tamer Higazi
@ 2010-08-22 9:27 ` Alex Schuster
2010-08-22 12:31 ` Giampiero Gabbiani
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: Alex Schuster @ 2010-08-22 9:27 UTC (permalink / raw
To: gentoo-user
Tamer Higazi writes:
> For a project I need to create ssh accounts (based on shared keys) who
> would be loged in a specific directory. They should only be able to
> login in the desired directory, but not be able for outside browsing.
If you need this only for things like scp, net-misc/scponly might do what
you want.
http://sublimation.org/scponly/wiki/index.php/Main_Page
Wonko
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-user] creating ssh account without directory browsing
2010-08-22 8:36 [gentoo-user] creating ssh account without directory browsing Tamer Higazi
2010-08-22 9:27 ` Alex Schuster
@ 2010-08-22 12:31 ` Giampiero Gabbiani
2010-08-22 14:49 ` Mick
2010-08-22 16:27 ` Alan McKinnon
2010-08-22 18:40 ` [gentoo-user] " Kalkin Sam
3 siblings, 1 reply; 8+ messages in thread
From: Giampiero Gabbiani @ 2010-08-22 12:31 UTC (permalink / raw
To: gentoo-user
In data domenica 22 agosto 2010 10:36:36, Tamer Higazi ha scritto:
: > Hi people!
> For a project I need to create ssh accounts (based on shared keys) who
> would be loged in a specific directory. They should only be able to
> login in the desired directory, but not be able for outside browsing.
>
>
> for example:
>
> /work/
>
> but not / or any other scope.
>
> How would you guys accomplish that?!
Hi Tamer,
simply set the default shell of the desired account to: /bin/bash -r.
In this mode the bash will start in restricted mode. You can get further
information about that in the man page of bash (section: RESTRICTED SHELL).
Bye
Giampiero
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-user] creating ssh account without directory browsing
2010-08-22 12:31 ` Giampiero Gabbiani
@ 2010-08-22 14:49 ` Mick
0 siblings, 0 replies; 8+ messages in thread
From: Mick @ 2010-08-22 14:49 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: Text/Plain, Size: 1080 bytes --]
On Sunday 22 August 2010 13:31:20 Giampiero Gabbiani wrote:
> In data domenica 22 agosto 2010 10:36:36, Tamer Higazi ha scritto:
> : > Hi people!
> >
> > For a project I need to create ssh accounts (based on shared keys) who
> > would be loged in a specific directory. They should only be able to
> > login in the desired directory, but not be able for outside browsing.
> >
> >
> > for example:
> >
> > /work/
> >
> > but not / or any other scope.
> >
> > How would you guys accomplish that?!
>
> Hi Tamer,
> simply set the default shell of the desired account to: /bin/bash -r.
> In this mode the bash will start in restricted mode. You can get further
> information about that in the man page of bash (section: RESTRICTED SHELL).
If you find that rbash is too restrictive, you can also restrict the access
rights of said users, so that they can only read/write their /home and the
/work directories. Use some sensible umasks to achieve this. SUID and SGID
files & binaries may be more difficult to restrict though.
--
Regards,
Mick
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-user] creating ssh account without directory browsing
2010-08-22 8:36 [gentoo-user] creating ssh account without directory browsing Tamer Higazi
2010-08-22 9:27 ` Alex Schuster
2010-08-22 12:31 ` Giampiero Gabbiani
@ 2010-08-22 16:27 ` Alan McKinnon
2010-08-22 18:40 ` [gentoo-user] " Kalkin Sam
3 siblings, 0 replies; 8+ messages in thread
From: Alan McKinnon @ 2010-08-22 16:27 UTC (permalink / raw
To: gentoo-user
Apparently, though unproven, at 10:36 on Sunday 22 August 2010, Tamer Higazi
did opine thusly:
> Hi people!
> For a project I need to create ssh accounts (based on shared keys) who
> would be loged in a specific directory. They should only be able to
> login in the desired directory, but not be able for outside browsing.
>
>
> for example:
>
> /work/
>
> but not / or any other scope.
>
> How would you guys accomplish that?!
Make that user's shell rbash.
In rbash the user cannot cd. There's a bunch of other stuff they also cannot
do. Check man bash near the end to make sure it satisfies your needs.
--
alan dot mckinnon at gmail dot com
^ permalink raw reply [flat|nested] 8+ messages in thread
* [gentoo-user] Re: creating ssh account without directory browsing
2010-08-22 8:36 [gentoo-user] creating ssh account without directory browsing Tamer Higazi
` (2 preceding siblings ...)
2010-08-22 16:27 ` Alan McKinnon
@ 2010-08-22 18:40 ` Kalkin Sam
2010-08-29 10:34 ` Tamer Higazi
3 siblings, 1 reply; 8+ messages in thread
From: Kalkin Sam @ 2010-08-22 18:40 UTC (permalink / raw
To: gentoo-user
Hi,
Young padawan Tamer Higazi <th982a@googlemail.com> spoke:
> Hi people!
> For a project I need to create ssh accounts (based on shared keys) who
> would be loged in a specific directory. They should only be able to
> login in the desired directory, but not be able for outside browsing.
I think you mean chroot. OpenSSH supports this, have a look at it.
kalkin-
--
Paranoid sein heisst frei sein
(Hal Faber)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-user] Re: creating ssh account without directory browsing
2010-08-22 18:40 ` [gentoo-user] " Kalkin Sam
@ 2010-08-29 10:34 ` Tamer Higazi
2010-09-05 16:55 ` Kalkin Sam
0 siblings, 1 reply; 8+ messages in thread
From: Tamer Higazi @ 2010-08-29 10:34 UTC (permalink / raw
To: gentoo-user
Hi Kalkin!
I have set up everything fine with SSH, and I am still not capable to
make the "chroot" option available with bluebream. Could you help me?!
My sshd_config:
http://pastebin.com/LHTUd1ah
Everytime I uncomment: "ChrootDirectory /work" and I try to connect, I
receive this message on the console:
Write failed: Broken pipe
Any ideas?!
On 22.08.2010 20:40, Kalkin Sam wrote:
> Hi,
>
> Young padawan Tamer Higazi <th982a@googlemail.com> spoke:
>> Hi people!
>> For a project I need to create ssh accounts (based on shared keys) who
>> would be loged in a specific directory. They should only be able to
>> login in the desired directory, but not be able for outside browsing.
>
> I think you mean chroot. OpenSSH supports this, have a look at it.
>
> kalkin-
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [gentoo-user] Re: creating ssh account without directory browsing
2010-08-29 10:34 ` Tamer Higazi
@ 2010-09-05 16:55 ` Kalkin Sam
0 siblings, 0 replies; 8+ messages in thread
From: Kalkin Sam @ 2010-09-05 16:55 UTC (permalink / raw
To: gentoo-user
Hi,
Young padawan Tamer Higazi <th982a@googlemail.com> spoke:
> Everytime I uncomment: "ChrootDirectory /work" and I try to connect, I
> receive this message on the console:
>
> Write failed: Broken pipe
>
>
> Any ideas?!
Yes RTFM and Google :)
man sshd_config and look at ChrootDirectory entry:
<cite> All components of the pathname must be root-owned directories
that are not writable by any other user or group. After the chroot,
sshd(8) changes the working directory to the user's home
directory</cite>
Here an Ubuntu forum which handles the same problem:
http://ubuntuforums.org/showthread.php?t=1482005
kalkin-
--
Paranoid sein heisst frei sein
(Hal Faber)
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2010-09-05 17:16 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-22 8:36 [gentoo-user] creating ssh account without directory browsing Tamer Higazi
2010-08-22 9:27 ` Alex Schuster
2010-08-22 12:31 ` Giampiero Gabbiani
2010-08-22 14:49 ` Mick
2010-08-22 16:27 ` Alan McKinnon
2010-08-22 18:40 ` [gentoo-user] " Kalkin Sam
2010-08-29 10:34 ` Tamer Higazi
2010-09-05 16:55 ` Kalkin Sam
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox