Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Log di Login [Risolto]
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Forum di discussione italiano
View previous topic :: View next topic  
Author Message
Galanti Davide
Tux's lil' helper
Tux's lil' helper


Joined: 23 Feb 2006
Posts: 148
Location: Milano (Italy)

PostPosted: Fri Mar 31, 2006 3:09 pm    Post subject: Log di Login [Risolto] Reply with quote

Scusate la domanda stupida, ma i log di login dove vengono salvati?

Last edited by Galanti Davide on Fri Mar 31, 2006 5:37 pm; edited 1 time in total
Back to top
View user's profile Send private message
federico
Advocate
Advocate


Joined: 18 Feb 2003
Posts: 3272
Location: Italy, Milano

PostPosted: Fri Mar 31, 2006 3:29 pm    Post subject: Reply with quote

Li trovi sotto /var/log/wtmp,
Code:

NAME
       utmp, wtmp - login records

ma e' un file che non puoi leggere comodamente utilizzando less o more.

Consiglio i comandi lastlog e last per leggere con comodita' gli ultimi login effettuati nel sistema.
_________________
Sideralis www.sideralis.org
Pic http://blackman.amicofigo.com/gallery
Arduino http://www.arduino.cc
Chi aveva potuto aveva spaccato
2000 pezzi buttati là
Molti saluti,qualche domanda
Semplice come musica punk
Back to top
View user's profile Send private message
Galanti Davide
Tux's lil' helper
Tux's lil' helper


Joined: 23 Feb 2006
Posts: 148
Location: Milano (Italy)

PostPosted: Fri Mar 31, 2006 3:55 pm    Post subject: Reply with quote

federico wrote:
Li trovi sotto /var/log/wtmp,
Code:

NAME
       utmp, wtmp - login records

ma e' un file che non puoi leggere comodamente utilizzando less o more.

Consiglio i comandi lastlog e last per leggere con comodita' gli ultimi login effettuati nel sistema.


Ma per vedere ad esempio se alcuni hanno sbagliato a mettere la password di un account, non si può?
Back to top
View user's profile Send private message
federico
Advocate
Advocate


Joined: 18 Feb 2003
Posts: 3272
Location: Italy, Milano

PostPosted: Fri Mar 31, 2006 4:02 pm    Post subject: Reply with quote

Si puo', il sistema dovrebbe essere gestito da pam (plugin login) ma non ti so dare la configurazione giusta per farlo. Personalmente controllo i login sbagliati solo da ssh, e non dal login locale perche' non mi pare molto utile.
In questo caso ho messo nel mio syslog-ng.conf questo

Code:

destination ssh { file("/var/log/sshd.log"); };
filter f_ssh { match("sshd"); };
log { source(src); filter(f_ssh); destination(ssh); };


che crea log simpatici come questo:

Code:

Mar 16 06:34:33 DigitalSNC sshd(pam_unix)[13638]: session closed for user blackman
Mar 16 09:45:59 DigitalSNC sshd(pam_unix)[5089]: session closed for user kattivo
Mar 16 16:26:58 DigitalSNC sshd[14841]: Accepted keyboard-interactive/pam for kattivo from 8x.5x.1x6.136 port 1971 ssh2
Mar 16 16:26:58 DigitalSNC sshd(pam_unix)[9971]: session opened for user kattivo by (uid=0)
Mar 16 16:52:03 DigitalSNC sshd[25151]: Did not receive identification string from 86.55.5.250
Mar 16 17:13:48 DigitalSNC sshd[23394]: Invalid user student from 86.55.5.250
Mar 16 17:13:50 DigitalSNC sshd[25424]: Invalid user student2 from 86.55.5.250
Mar 16 17:13:52 DigitalSNC sshd[25344]: Invalid user oracle from 86.55.5.250
Mar 16 17:15:52 DigitalSNC sshd[5185]: fatal: Timeout before authentication for 86.55.5.250
Mar 16 18:46:19 DigitalSNC sshd[1343]: Accepted keyboard-interactive/pam for kattivo from 8x.5x.1x6.136 port 2255 ssh2
Mar 16 18:46:19 DigitalSNC sshd(pam_unix)[25346]: session opened for user kattivo by (uid=0)


dai quali per altro possiao notrare che qualcuno ha provato a loggarsi con utenti (oracle e student*) che neanche esistono sulla macchina e altre amenita'.

per creare un log di sshd, poi in particolare lo do in pasto a un programma che si chiama fail2ban che droppa i tentativi di connessione da ip che hanno gia' sbagliato 3 volte la password, ma questa e' tutta un'altra storia.
_________________
Sideralis www.sideralis.org
Pic http://blackman.amicofigo.com/gallery
Arduino http://www.arduino.cc
Chi aveva potuto aveva spaccato
2000 pezzi buttati là
Molti saluti,qualche domanda
Semplice come musica punk
Back to top
View user's profile Send private message
makoomba
Bodhisattva
Bodhisattva


Joined: 03 Jun 2004
Posts: 1856

PostPosted: Fri Mar 31, 2006 4:14 pm    Post subject: Reply with quote

Code:
destination auth { file("/var/log/auth.log"); };
...
filter auth { facility(auth, authpriv) and not level(debug); };
...
log { source(src); filter(auth); destination(auth); };

Code:
Mar 31 11:30:15 mail sshd(pam_unix)[17033]: session opened for user root by root(uid=0)
Mar 31 17:35:01 mail sshd[19394]: Accepted publickey for root from 10.0.0.4 port 55843 ssh2
Mar 31 17:35:01 mail sshd(pam_unix)[19396]: session opened for user root by root(uid=0)
Mar 31 18:11:58 mail login(pam_unix)[27159]: authentication failure; logname= uid=0 euid=0 tty=tty1 ruser= rhost=  user=root
Mar 31 18:12:00 mail login[27159]: FAILED LOGIN 1 FROM  FOR root, Authentication failure
Mar 31 18:12:09 mail login[27159]: FAILED LOGIN 2 FROM  FOR root, Authentication failure
Mar 31 18:12:17 mail login(pam_unix)[27159]: check pass; user unknown
Mar 31 18:12:17 mail login(pam_unix)[27159]: check pass; user unknown
Mar 31 18:12:17 mail login(pam_unix)[27159]: authentication failure; logname= uid=0 euid=0 tty=tty1 ruser= rhost=
Mar 31 18:12:17 mail pam_tally[27159]: pam_tally: pam_get_uid; no such user RrRrRRRR
Mar 31 18:12:28 mail login(pam_unix)[19705]: authentication failure; logname= uid=0 euid=0 tty=tty1 ruser= rhost=  user=root
Mar 31 18:12:30 mail login[19705]: FAILED LOGIN 1 FROM  FOR root, Authentication failure

_________________
When all else fails, read the instructions.
Back to top
View user's profile Send private message
Galanti Davide
Tux's lil' helper
Tux's lil' helper


Joined: 23 Feb 2006
Posts: 148
Location: Milano (Italy)

PostPosted: Fri Mar 31, 2006 5:36 pm    Post subject: Reply with quote

Vi ringrazio a entrambi :)

erano due cose che mi servivano :D
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Forum di discussione italiano All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum