[Tecnica] Ssh e configurazione multi-utente

Vincenzo Di Massa hawk78 a interfree.it
Lun 5 Mar 2007 10:16:55 GMT


Alle domenica 4 marzo 2007, Yusef Maali ha scritto:
> Alle 12:49, domenica 04 marzo 2007, Vincenzo Di Massa ha scritto:
> > Vediamo se ho capito la domanda...
>
> a fiducia direi di no :P
>
> > Alle giovedì 1 marzo 2007, Yusef Maali ha scritto:
> > > poter dare l'accesso shell ad alcuni utenti e ad altri no,
> >
> > Questo è facile AllowUsers e DenyUsers (da manuale ;-) ) fanno proprio
> > questo.
>
> Qui forse mi sono spiegato male.
> Se tu usi programmi che fanno tunnelling attraverso ssh, ad esempio git+ssh
> oppure svn+ssh, il client ssh non crea una vera sessione shell, ma si
> autentica, fa partire i programmi che sono richiesti e chiude tutto.
> Facendo un "ps aux" si vede che ssh apre una sessione user a notty.
>
> In sostanza a me interessa permettere questo tipo di utilizzo, ma non
> l'utilizzo della shell (bash) con tutte le sue funzionalità, che è un
> problema diverso dal permettere/non permettere l'autenticazione.


Leggendo il man di sshd
"""
LOGIN PROCESS
     When a user successfully logs in, sshd does the following:

           1.   If the login is on a tty, and no command has been specified, 
prints last login time and /etc/motd (unless prevented in the configuration 
file or by ~/.hushlogin; see the FILES
                section).

           2.   If the login is on a tty, records login time.

           3.   Checks /etc/nologin; if it exists, prints contents and quits 
(unless root).

           4.   Changes to run with normal user privileges.

           5.   Sets up basic environment.

           6.   Reads the file ~/.ssh/environment, if it exists, and users are 
allowed to change their environment.  See the PermitUserEnvironment option in 
sshd_config(5).

           7.   Changes to user’s home directory.

           8.   If ~/.ssh/rc exists, runs it; else if /etc/ssh/sshrc exists, 
runs it; otherwise runs xauth.  The “rc” files are given the X11 
authentication protocol and cookie in standard input.

           9.   Runs user’s shell or command.
"""
deduco che basti disabilitare il login per l'utente togliendo /bin/bash 
da /etc/passwd e mettendoci /bin/false... Facile!
Oppure gli utenti devono poter usare la shell da locale ma non da remoto?

Inventiamo un altro nuovo acronimo CRAFTED! ( Carefully Read Again, Fu*k, The  
Exaustive Documentation!) :-P 
Questo è anche più bellino!

Ciao
Vincenzo

> > > permettere il
> > > forwarding ad alcuni e ad altri no, ecc...
> >
> > Ma a cosa serve???? Gli utenti che possono accedere seza forwarding
> > possono fare lo stesso il forwarding "a manina"!
> > [SNIP]
> > Si capisce che il server non corre più rischi a disabilitare il
> > forwarding... e anche se lo fa è (ovviamente) possibile fare forwarding
> > in 1000000 di altri modi.
>
> Vero, ma alla fine è una conseguenza del punto precedente. Se ci fosse il
> modo di non darti l'accesso a bash, ma di farti fare tunnelling, non hai
> neanche modo di fare fowarding a meno che tu non sia estremamente sveglio!
> Ma in tal caso l'unico modo per salvarsi è non dare proprio accesso.
>
> > Bhe inventiamo un nuovo acronimo CRTFM,Y! ( Carefully Read The Fu**ing
> > Manual, Yusef!) ;-)
>
> RIMMTFQ (Read In My Mind The Fu**ing Question!) :P :P :P
> Ciao!!!!!




Maggiori informazioni sulla lista Tecnica