[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: SSH ve login ile bir programi tetiklemek: Nasil?



Selam Emre,

Aşağıda ssh manual ından aldığım bir kısmı yolluyorum. 8. adımda istediğini gerçekleştirebilirsin.

Ercümend Oyuktaş


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 $HOME/.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 $HOME/.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 $HOME/.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.

-----Original Message-----
From: Emre Sevinç [mailto:emres@bilgi.edu.tr] 
Sent: 18 Ekim 2006 Çarşamba 20:26
To: debian-user-turkish
Subject: SSH ve login ile bir programi tetiklemek: Nasil?


Merhaba,

Asagidaki islevi en sade ve acisiz sekilde gerceklestirmek icin 
önerileri bekliyorum:

- Makinaya sadece ve sadece SSH üzerinden *basarili* sekilde login 
olundugunda WXYZ  programi calissin.

Yani ben makina basinda fiziksel olarak bulunup basarili login 
gerceklestiginde WXYZ tetiklenmeyecek, sadece
bu SSH üzerinden oldugunda program tetiklenecek.

Bunun icin halihazirda bir altyapi var midir yoksa akliniza gelen 
öneriler "bir servis yaz arkada calissin, her su kadar
milisaniyede bir filanca log dosyasini kontrol edip is yapsin" seklinde 
midir?

sshd man sayfasinda

$HOME/.ssh/rc
             If this file exists, it is run with /bin/sh after reading 
the environment files but before starting the user's shell or command.  
It must not
             produce any output on stdout; stderr must be used instead.  
If X11 forwarding is in use, it will receive the "proto cookie" pair in 
its stan-
             dard input (and DISPLAY in its environment).  The script 
must call xauth(1) because sshd will not run xauth automatically to add 
X11 cookies.

             The primary purpose of this file is to run any 
initialization routines which may be needed before the user's home 
directory becomes accessi-
             ble; AFS is a particular example of such an environment.


gibi bir bölüm buldum ancak bu da $HOME lafinin cagristirdigi dogrultuda 
belli bir kullanici dizininde bir dosya
oldugunu var sayiyor, yani sisteme basarili giris yapabilecek tüm 
kullanicilarin "home" dizinlerinde bu dosyanin
olma mecburiyeti var gibi algiladim.

Bunlarin haricinde olasi bir cözüm alternatifi var midir acep?


-- 
Emre Sevinç
eMBA Yazılım Geliştirme
İstanbul Bilgi Üniversitesi



-- 
To UNSUBSCRIBE, email to debian-user-turkish-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: