Showing posts with label users. Show all posts
Showing posts with label users. Show all posts

Thursday, December 8, 2011

Windows Server 2008 Domain Controller and DNS Server Setup

This tutorial will explain how to setup Windows Server 2008 Domain Controller and DNS
Server.

Click on Start > Run

clip_image002
Now type dcpromo > Click OK

clip_image004

The system will start checking if Active Directory Domain Services ( AD DS) binaries are installed, then will start installing them. The binaries could be installed if you had run the dcpromo command previously and then canceled the operation after the binaries were installed.

clip_image006

clip_image008

The Active Directory Domain Services Installation Wizard will start, either enable the checkbox beside Use Advanced mode installation and Click Next , or keep it unselected and click on Next

clip_image010

The Operating System Compatibility page will be displayed, take a moment to read it and click Next

clip_image012

Choose Create a new domain in a new forest, Click Next

clip_image014

Enter the Fully Qualified Domain Name of the forest root domain inside the textbox, click Next

clip_image016

If you selected Use advanced mode installation on the Welcome page, the Domain NetBIOS Name page appears. On this page, type the NetBIOS name of the domain if necessary or accept the default name and then click Next.

clip_image018

Select the Forest Functional Level, choose the level you desire and click on Next.

clip_image020

Make sure to read the description of each functional level to understand the difference between each one.

In the previous step, If you have selected any Forest Functional Level other than windows Server 2008 and clicked on Next , you would then get a page to select the domain Functional Level. Select it and then click on Next

clip_image022

In the Additional Domain Controller Options page, you can select to install the domain Name Service to your server. Note that the First domain controller in a forest must be a Global Catalog that’s why the checkbox beside Global Catalog is selected and it cannot be cleared. The checkbox is also selected by default when you install an additional domain controller in an existing domain, however you can clear this checkbox if you do not want the additional domain controller to be a global catalog server. The first domain controller in a new forest or in a new domain can not be a Read Only Domain Controller (RODC), you can later add a RODC but you must have at least one Windows Server 2008 Domain Controller.

I want to set my DC as a DNS Server as well, so I will keep the checkbox beside DNS server selected and click on Next

clip_image024

If you don’t have static ip assigned to your server you will see similar to the following screen now you need to assign static ip and start the above process.

clip_image026

If the wizard cannot create a delegation for the DNS server, it displays a message to indicate that you can create the delegation manually. To continue, click Yes

clip_image028

Now you will have the location where the domain controller database, log files and SYSVOL are stored on the server.

The database stores information about the users, computers and other objects on thenetwork. the log files record activities that are related to AD DS, such information about an object being updated. SYSVOL stores Group Policy objects and scripts. By default, SYSVOL is part of the operating system files in the Windows directory either type or browse to the volume and folder where you want to store each, or accept the defaults and click on Next

clip_image030

In the Directory Services Restore Mode Administrator Password (DSRM) page, write a password and confirm it. This password is used when the domain controller is started in Directory Services Restore Mode, which might be because Active Directory Domain services is not running, or for tasks that must be performed offline.Make sure that you memorize this password when you need it.

clip_image032

Summary page will be displayed showing you all the setting that you have set . It gives you the option to export the setting you have setup into an answer file for use with other unattended operations, if you wish to have such file, click on the Export settings button and save the file.

clip_image034

DNS Installation will start

clip_image036

Followed by installing Group Policy Management Console, the system will check first if it is installed or not.

clip_image038

clip_image040

Configuring the local computer to host active directory Domain Services and other operations will take place setting up this server as a Domain Controller active Directory Domain Services installation will be completed, click Finish.

clip_image042

Click on Restart Now to restart your server for the changes to take effect.

clip_image044

Once the server is booted and you logon to it, click on Start > Administrative Tools
you will notice that following have been installed :
Active Directory Domains and Trusts
Active Directory Sites and Services
Active Directory Users and Computers
ADSI Edit
DNS
Group Policy Management

clip_image046

That’s it now your new win server 2008 domain controller with dns server setup was completed.

Taken From: http://www.windowsreference.com/windows-server-2008/step-by-step-guide-for-windows-server-2008-domain-controller-and-dns-server-setup/

Friday, October 10, 2008

Adding a User to a Group - Linux

Q. How can I add a user to a group under Linux operating system?

A. You can use useradd or usermod commands to add a user to a group. useradd command creates a new user or update default new user information. usermod command modifies a user account i.e. it is useful to add user to existing group. There are two types of group. First is primary user group and other is secondary group. All user account related information is stored in /etc/passwd, /etc/shadow and /etc/group files to store user information.

useradd example - Add a new user to secondary group

Use useradd command to add new users to existing group (or create a new group and then add user). If group does not exist, create it. Syntax:
useradd -G {group-name} username
Create a new user called vivek and add it to group called developers. First login as a root user (make sure group developers exists), enter:
# grep developers /etc/group
Output:

developers:x:1124:

If you do not see any output then you need to add group developers using groupadd command:
# groupadd developers
Next, add a user called vivek to group developers:
# useradd -G developers vivek
Setup password for user vivek:
# passwd vivek
Ensure that user added properly to group developers:
# id vivekOutput:

uid=1122(vivek) gid=1125(vivek) groups=1125(vivek),1124(developers)

Please note that capital G (-G) option add user to a list of supplementary groups. Each group is separated from the next by a comma, with no intervening whitespace. For example, add user jerry to groups admins, ftp, www, and developers, enter:
# useradd -G admins,ftp,www,developers jerry

useradd example - Add a new user to primary group

To add a user tony to group developers use following command:
# useradd -g developers tony
# id tony

uid=1123(tony) gid=1124(developers) groups=1124(developers)
Please note that small -g option add user to initial login group (primary group). The group name must exist. A group number must refer to an already existing group.

usermod example - Add a existing user to existing group

Add existing user tony to ftp supplementary/secondary group with usermod command using -a option ~ i.e. add the user to the supplemental group(s). Use only with -G option :


# usermod -a -G ftp tonyChange existing user tony primary group to www:
# usermod -g www tony

Taken From: http://www.cyberciti.biz/faq/howto-linux-add-user-to-group/

Sunday, July 15, 2007

Gestão de Utilizadores (Linux)

Hugo Cisneiros, hugo_arroba_devin_ponto_com_ponto_br
Última atualização em 12/02/2003

Como você já deve saber, o Linux é um sistema multi-usuário, então, é claro que não só pode existir um usuário usando o sistema. Uma primeira coisa que possamos dizer é que o Linux não pode de alguma maneira ser usada sem estar sendo um usuário. O usuário 'root' é o administrador do sistema, e é ele quem você vai usar primeiro para criar outros usuários depois (a não ser que você tenha criado um usuário comum durante a instalação do seu Linux).

Antes de mais nada, fique sabendo que o root é um usuário especial, ele pode fazer TUDO em seu sistema, não importa o que acontecer, ele faz. Ao contrário dos usuários comuns, que têm restrições. Se você já instalou algum Linux, você verá que a primeira coisa que você irá fazer antes de usar o sistema é se logar como root, ou seja, preencher aquele campo login: com o usuário root. Mas aí por alguma razão você quer mudar de usuário, ou criar outro, ou qualquer coisa do tipo, então você se pergunta: "Como?"

Há um comando específico para isto. Este comando é o "adduser" ou "useradd". Dependendo da distribuição, o comando "adduser" vai ser apenas um comando igual ao "useradd", ou então um script interativo que irá lhe fazendo perguntas, você irá preenchendo, e então o script criará um usuário no sistema para você.

No caso do "adduser" ser um comando mesmo, você poderá utilizar assim:

adduser hugo
passwd hugo

Isso respectivamente irá criar um usuário padrão chamado hugo, e depois com o comando "passwd", você definirá uma senha para este usuário. Você pode especificar outros parâmetros para o usuário, como no comando a seguir:

adduser hugo -d /var/usuarios/hugo -s /dev/null

Com estes parâmetros, especifiquei que o usuário hugo terá como diretório home o "/var/usuarios/hugo" e como shell o "/dev/null" (ou seja, não terá shell). Sem estes parâmetros, o diretório home seria "/home/hugo" e o shell seria "/bin/bash".

Vamos entender agora como este comando funciona, que é uma coisa essencial que todos deveriam saber em relação ao sistema Linux. Cada um desses programas escrevem o usuário no arquivo de configuração do Linux referente aos usuários do sistema. Este arquivo é o "/etc/passwd". Cada linha deste arquivo é um usuário cadastrado no sistema. Com as informações que vou lhe dar aqui, você pode muito bem criar uma conta sem usar estes programas/scripts citados acima.

O passwd é formado por linhas onde cada linha é um usuário, como falei acima, então vamos aprender a montar cada linha desta. Vou pegar um exemplo para vocês:

hugo:x:1001:100:Hugo Cisneiros:/home/hugo:/bin/bash

Vamos dividir esta linha em "campos", onde cada um é separado por : (dois pontos), olhe só:

CampoSignificado
hugoLogin do Usuário, aqui você pode colocar o nome que quiser com até 8 caracteres.
xAqui diz que o password está no arquivo /etc/shadow. Se estivesse *, a conta estaria desabilitada, e se estivesse sem nada (::), a conta não teria password.
1001UID (User IDentification), o número de identificação do usuário.
100GID (Group IDentification), o número de identificação do grupo do usuário.
Hugo CisneirosComentários do usuário, como nome, telefone, etc
/home/hugoO diretório HOME do usuário, ou seja, o diretório pertencente a ele. Geralmente estes diretorios sempre estao no /home
/bin/bashShell do usuário, ou seja, o programa que irá enterpretar os comandos que o usuário executar.

Obs: O /etc/shadow é um arquivo que contém a senha do usuário criptografada, se alguém tiver posse dela, esta pessoa pode muito bem comparar as senhas com uma lista de palavras, e pode descobrir as senhas dos usuários. Felizmente este arquivo está muito bem protegido pelo sistema :)

Bem, legal, aprendi sobre adicionar um usuário, mas como faço para removê-lo? Simples, você pode apagar a linha referente a ele no /etc/passwd e os seus arquivos, ou simplesmente digitar userdel usuario. Combine com a opção -r para deletar junto o diretório HOME do usuário.

Ahhhhh? Você quer mais? O quê? Quer deixar um usuário como se fosse root? Então vamos lá que não temos nada a perder! O root possui o UID e o GID igual à 0 (zero), e um usuário comum não. Se nós forçássemos a mudança do UID e GID de um usuário para 0, ele ficaria como se fosse o root! Por exemplo, eu tenho a linha do usuário no /etc/passwd e mudo:

hugo:x:1001:100:Hugo Cisneiros:/home/hugo:/bin/bash
hugo:x:0:0:Hugo Cisneiros:/home/hugo:/bin/bash
^ ^

Pronto, o usuário hugo vai ser também o root do sistema, o administrador do sistema, o deus do sistema, etc. Outra dica: Não é muito bom ficar usando o usuário root, este usuário é somente para a administração do sistema, então eu recomendo à você a usar sempre um usuário normal, ser da plebe :) E se for precisar usar o root, logar como ele ou utilizar o comando "su -" para se tornar o próprio root.

Outro arquivo que tem muito haver com os usuários no Linux é o /etc/group. Que contém as definições de cada grupo, como por exemplo seus nomes, GIDs, e usuários adicionais que pertencem à ele. Você adicionando uma linha neste arquivo estará criando um novo grupo. Vamos criar aqui um novo grupo no /etc/group:

metal:x:666:hugo,jim,eitch

Adicionando esta linha acima no arquivo /etc/group, um novo grupo é criado: com o nome 'metal', o GID '666' e como usuários adicionais pertencentes à ele, 'hugo, jim, eitch'. Fácil não?

Bem é isso, combinando este conhecimento com algo sobre permissões dos arquivos, você pode controlar muito bem quem usa o seu sistema ou servidor, dizendo quem pertence à que grupo, quais seus diretórios, que arquivos podem acessar, entre outros. Bom proveito!

Hugo Cisneiros, hugo_arroba_devin_ponto_com_ponto_br

Tirado de: http://www.devin.com.br/eitch/manip_usuarios/