Linux-Bulgaria.ORG
навигация

 

начало

пощенски списък

архив на групата

семинари ...

документи

как да ...

 

 

Предишно писмо Следващо писмо Предишно по тема Следващо по тема По Дата По тема (thread)

Re: lug-bg: SFTP bez validen shell


  • Subject: Re: lug-bg: SFTP bez validen shell
  • From: sheib@xxxxxxxxxxxxxxxxx (sheib)
  • Date: Thu, 16 Jan 2003 17:54:47 +0200 (EET)



tova ti e shella:

--snip--

#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/syslog.h>
#include <sys/sysmacros.h>

#define SFTP_COMMAND "/usr/libexec/openssh/sftp-server"

   main(int argc, char **argv)
   {
       int i;

       if (argc!=3) {
           syslog(LOG_ERR,
               "ACCESS DENIED %s: illegal number of arguments=%d",
               argv[0],argc);
           for (i=1;i<argc;i++) {
               syslog(LOG_ERR,"%s argv[%d]: %s",argv[0],i,argv[i]);
               }
           goto Denied;
           }
       if (strcmp(argv[1],"-c") || strcmp(argv[2],SFTP_COMMAND)) {
           syslog(LOG_ERR,
               "ACCESS DENIED %s: illegal arguments: %s %s",
               argv[0],argv[1],argv[2]);
           goto Denied;
           }

             return(execl(argv[2],argv[2],NULL));

     Denied:
     printf("You don't have shell access on this machine. Keep out.\n");
         return(2);
     }

--snip--

ili ..

#!/bin/sh

/usr/libexec/openssh/sftp-server -c $*

/s

On Thu, 16 Jan 2003, Vesselin Kolev wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Zdrveite,
>   V komersialnia analog na OpenSSH e vyzmozhno da se
> pravi SFTP sesia ot user, koito niama validen shell v sistemata.
> Tova stava blagodarenie na dummy-shell.
>
>   Opitvah razni varianti da napravia tova i s OpenSSH, no ne
> stava...
>
>   Ima li niakoi predstava dali tova e vyzmozhno izobshto v
> OpenSSH i ako da.. kak stava.
>
>    Blagodarnosti
>
>     Vesselin Kolev
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.1 (GNU/Linux)
>
> iD8DBQE+JsEE+48lZPXaa+MRAkYmAKDiBa+owuO9rI19Ti97MbpdVGLlsgCePQS4
> 21UyLPd9SpzuZxf00dP7kGk=
> =6lbs
> -----END PGP SIGNATURE-----
>
> ============================================================================
> A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers).
> http://www.linux-bulgaria.org - Hosted by Internet Group Ltd. - Stara Zagora
> To unsubscribe: http://www.linux-bulgaria.org/public/mail_list.html
> ============================================================================
>
============================================================================
A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers).
http://www.linux-bulgaria.org - Hosted by Internet Group Ltd. - Stara Zagora
To unsubscribe: http://www.linux-bulgaria.org/public/mail_list.html
============================================================================



 

наши приятели

 

линукс за българи
http://linux-bg.org

FSA-BG
http://fsa-bg.org

OpenFest
http://openfest.org

FreeBSD BG
http://bg-freebsd.org

KDE-BG
http://kde.fsa-bg.org/

Gnome-BG
http://gnome.cult.bg/

проект OpenFMI
http://openfmi.net

NetField Forum
http://netField.ludost.net/forum/

 

 

Linux-Bulgaria.ORG

Mailing list messages are © Copyright their authors.