sexta-feira, março 16, 2012

Impedir usuários de efetuarem logon - Linux.

Para impedir usuários efetuarem logon em um sistema Linux basta criar o arquivo nologin em \etc, assim somente o usuário root poderá efetuar login.
Ex:

root@debian:~# touch /etc/nologin
root@debian:~# login
debian login: maykon

Login incorrect
debian login:
------------------
Não obetive sucesso ao tenta efetuar login com o usuário maykon, só depois de remover o arquivo nologin que foi possível o acesso.

root@debian:~# rm /etc/nologin
root@debian:~# login
debian login: maykon
Password:
Last login: Fri Mar 16 13:33:41 BRT 2012 on pts/0
Linux debian 2.6.32-5-amd64 #1 SMP Mon Jan 16 16:22:28 UTC 2012 x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
maykon@debian:~$

terça-feira, março 13, 2012

Command chage

chage - change user password expiry information.

Information root.
#chage -l root

-M option maxdays is the maximum number of days during which a password is valid, 0 user maykon will be required to change password.
#chage -M 7 maykon

-W set the number of days of warning before a password change is required.
#chage -W 7 maykon

Ex:
root@slack:~# login
slack login: maykon
Password:
Linux 2.6.29.6-smp.
Last login: Tue Mar 13 09:36:16 -0300 2012 on pts/0.
Your password will expire in 7 days.
No mail.
maykon@slack:~$

-E set a date on which the user's account will no longer be accessible, this option is the number of days since January 1, 1970.
#chage -E 8 maykon
Account Expires: Jan 09, 1970 ;-).

sexta-feira, março 09, 2012

Manage User and Group

Create de account maykon, -m create home directory, -s shell
#useradd -m maykon -s /bin/bash

Modify user account, -L Lock password, -U Unlock.
#usermod -L maykon

Delete account, -r delete home directory.
#usedel -r maykon

Add group to the system.
# groupadd centipede

Modify group, change name centipede for centipede2
#groupmod -n centipede2 centipede

Delete group
#groupdel centipede2

Set password
#passwd user

Command is used to administer groups, add root for group centipede
#gpasswd -a root centipede

User\Group account and Password Files:

#/etc/passwd – Username, Password (hashed), User ID, Group ID, Full Name, Home Directory, Default Shell.

#/etc/group – Group Name, Group Password, Group ID, Group Member List.

#/etc/shadow – Shadow is a file which contains the password information for the system's.

#/etc/gshadow - file is readable only by the root user and contains an encrypted password for each group.

terça-feira, março 06, 2012

LPI Level 1 Exame 101

Hoje realizei o exame 101, foram 60 questões (pontuação 680), e consegui passar, agora é só estudar para a 102 que pretendo realizar em abril.