redhat 18 samba nis ssh

Upload: souvik-ganguly

Post on 05-Apr-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    1/60

    CONFIDENTIALDocument Name

    Andrew Tridgell wrote a SMB [server message block] client and server that he calledSamba.

    Samba is a collection of Linux tools that allow you to communicate with windowssystems over a network.

    Helps in browsing the network resources using host names by name resolutioninstead of DNS.

    File and printer sharing is probably the most attractive samba feature.

    Samba configuration

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    2/60

    CONFIDENTIALDocument Name

    Packages : samba, samba-common, samba-client

    Daemons : smbd, nmbd (NetBIOS nameserver)

    Config file : /etc/samba/smb.conf

    Ports : 137 (nmbd), 138(smbd)

    Samba Service Profile

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    3/60

    CONFIDENTIALDocument Name

    Samba configuration

    rpm -q queries

    for the packages

    installed.

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    4/60

    CONFIDENTIALDocument Name

    Samba configuration

    rpm -ivh along with

    package name installs

    the package.

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    5/60

    CONFIDENTIALDocument Name

    /etc/samba/smb.conf is the

    configuration file.

    Samba configuration

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    6/60

    CONFIDENTIALDocument Name

    The smb.conf file is

    opened now to edit.

    Samba configuration

    The windows domain

    name or the workgroup

    name can be given.

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    7/60CONFIDENTIALDocument Name

    This is the default screen

    showing the default network

    for accessing.

    Samba configuration

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    8/60CONFIDENTIALDocument Name

    The screen shows that the network

    192.168.0 and 192.168.1 can access

    the samba server.

    Samba configuration

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    9/60CONFIDENTIALDocument Name

    At the end of the smb.conf file,

    shows the example of how to share

    the linux files.

    Samba configuration

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    10/60CONFIDENTIALDocument Name

    The previous example is used here

    as such like tmp and var directory.

    Samba configuration

    The tmp directory is shared to

    public(full access) as well as write

    the file.

    The var directory is given as theuser joe only can access the file

    from any windows operating

    system.

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    11/60CONFIDENTIALDocument Name

    Password is set for accessing from

    the windows operating system.

    Samba configuration

    Samba user name and password

    are stored in/etc/samba/smbpasswd file.

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    12/60CONFIDENTIALDocument Name

    The service for the samba

    configuration is started by

    restarting.

    Samba configuration

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    13/60CONFIDENTIALDocument Name

    smbclient -L shows the shared

    directory of samba server.

    Samba configuration

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    14/60

    CONFIDENTIALDocument Name

    This command helps to

    confirm whether the

    configuration is done properly.

    Samba configuration

    The user joe gets logged in by

    giving password for

    authentication. ls command is

    used to list the files shared.

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    15/60

    CONFIDENTIALDocument Name

    The screen viewing the listed files.

    mget command copy the file from

    shared directory to our machine.

    Samba configuration

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    16/60

    CONFIDENTIALDocument Name

    testparm command is used

    to show the shared

    directory of the samba

    server.

    Samba configuration

    Hitting enter will show the

    detailed shared directory.

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    17/60

    CONFIDENTIALDocument Name

    Here the screen shows the

    simulation of the samba

    configuration.

    Samba configuration

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    18/60

    CONFIDENTIALDocument Name

    NIS

    - Network information service.

    - NIS stores administrative files in /etc/passwd, /etc/hosts etc., in DB

    files.

    - These Datas are available over the network to all clients that are

    connected to the NIS domain.

    - NIS client daemon (ypbind) finds a server for its

    NIS Domain by sending a broadcast request.

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    19/60

    CONFIDENTIALDocument Name

    Packages : ypserv, ypbind, yp-tools

    Daemons : ypserv, ypbind, rpc.yppasswdd

    Config. Files : /etc/ypserv.conf (server)

    /var/yp/*,

    /etc/sysconfig/network (common)

    /etc/nsswitch.conf, (client)

    /etc/yp.conf

    Port : 111 (assigned byportmap)

    NIS: Service profile

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    20/60

    CONFIDENTIALDocument Name

    Define the NIS domain name that the NIS server will work for.

    Start the ypserv daemon.

    In the /var/yp/Makefile file, set any NIS server options and specify the configuration

    files to manage.

    Use ypinit to create the NIS versions of the configuration file.

    Steps to Configure NIS

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    21/60

    CONFIDENTIALDocument Name

    NIS Configurations

    Query is made to check

    whether the portmap and

    ypserv are installed. if not,

    install the packages

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    22/60

    CONFIDENTIALDocument Name

    To set the nis domain name

    temporarily, nisdomainname

    command is used.

    NIS Configurations

    To set nis domain name

    permanently, entries are made at

    /etc/sysconfig/network.

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    23/60

    CONFIDENTIALDocument Name

    Enter the nis domain

    name.Here our nis domain

    is nis

    NIS Configurations

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    24/60

    CONFIDENTIALDocument Name

    Start the portmap and

    ypserv services.

    NIS Configurations

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    25/60

    CONFIDENTIALDocument Name

    Open the nis

    configuration file.

    NIS Configurations

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    26/60

    CONFIDENTIALDocument Name

    nopush options is set to true if

    there is no nis slave server.andit is set to false if there is a

    slave sever.

    NIS Configurations

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    27/60

    CONFIDENTIALDocument Name

    The minimum user and

    group Ids are set to 500.

    NIS Configurations

    MERGE_PASSWD is to true than

    the password file and the shadow

    file will be merge.

    MERGE_GROUP is set

    to true than the group

    file and the gshadow file

    will be merge.

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    28/60

    CONFIDENTIALDocument Name

    The files that are shared on thenetwork are listed in the all.

    NIS Configurations

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    29/60

    CONFIDENTIALDocument Name

    This command

    create the nis

    database consistingof the nis

    configuration file.

    NIS Configurations

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    30/60

    CONFIDENTIALDocument Name

    Create a control access file

    named securents, which

    enables access by hosts to

    the nis server.

    NIS Configurations

    Open thecontrol access

    file.

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    31/60

    CONFIDENTIALDocument Name

    Here we are giving access all the

    hosts in the network 192.168.0.0

    and the localhost.

    NIS Configurations

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    32/60

    CONFIDENTIALDocument Name

    Restart the yppasswdd andypserv services.

    NIS Configurations

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    33/60

    CONFIDENTIALDocument Name

    In client side check for the

    ypbind package.

    NIS Configurations

    This command is

    used to indicate the

    nis server.

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    34/60

    CONFIDENTIALDocument Name

    Select the NIS option and enter the

    nis domain name and its ip address

    and press next.

    NIS Configurations

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    35/60

    CONFIDENTIALDocument Name

    Press ok tocontinue.

    NIS Configurations

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    36/60

    CONFIDENTIALDocument Name

    ypcat lists any NIS configurationfile here we can see the password

    file.

    NIS Configurations

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    37/60

    CONFIDENTIALDocument Name

    ypmatch command is used to view

    a particular users entry in the

    configuration file.

    NIS Configurations

    Open the

    auto.master file.

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    38/60

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    39/60

    CONFIDENTIALDocument Name

    Open theauto.misc file.

    NIS Configurations

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    40/60

    CONFIDENTIALDocument Name

    Mention the NIS server ip address

    and the home directory to bemounted.

    NIS Configurations

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    41/60

    CONFIDENTIALDocument Name

    Restart the autofs

    service .

    NIS Configurations

    S h ll (SSH)

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    42/60

    CONFIDENTIALDocument Name

    Secure shell (SSH)

    Secure Shell

    Allows remote logins and remote command execution via secure encryptedconnections.

    Syntax:

    ssh @

    S h ll (SSH)

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    43/60

    CONFIDENTIALDocument Name

    Secure shell (SSH)

    Service for the sshd is

    restarted.

    S h ll (SSH)

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    44/60

    CONFIDENTIALDocument Name

    Secure shell (SSH)

    Open the file

    hosts.allow.

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    45/60

    Sec re shell (SSH)

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    46/60

    CONFIDENTIALDocument Name

    Secure shell (SSH)

    Open the hosts.deny

    file.

    Secure shell (SSH)

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    47/60

    CONFIDENTIALDocument Name

    Secure shell (SSH)

    sshd : ALL entered above means

    that except example .com others

    are restricted to access.

    Secure shell (SSH)

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    48/60

    CONFIDENTIALDocument Name

    Secure shell (SSH)

    Look at the client machine it is

    available in the example.com domain.

    Secure shell (SSH)

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    49/60

    CONFIDENTIALDocument Name

    Secure shell (SSH)

    From the host satation41 we

    logged as root in

    station20.example.com

    O h

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    50/60

    CONFIDENTIALDocument Name

    Open SSH replaces common, insecure network communication skills.

    Provides greater data security between networked systems.

    Capable of tunneling in secured protocols through forwarding.

    Open ssh

    Open ssh

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    51/60

    CONFIDENTIALDocument Name

    Open ssh

    Packages : openssh-clients, openssh-server

    Daemons : sshd

    Config. Files : /etc/ssh/*, $home/.ssh

    Port : 22

    Open ssh

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    52/60

    CONFIDENTIALDocument Name

    Open ssh

    The openssh packages are installed

    Open ssh

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    53/60

    CONFIDENTIALDocument Name

    Service sshd is

    restarted.

    Open ssh

    Open ssh

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    54/60

    CONFIDENTIALDocument Name

    Keygen is used to generate

    public and private keys

    using DSA algorithm.

    Open ssh

    The generated private key is saved

    in id_dsa file.

    The generated public key is saved

    in id_dsa.pub file.

    Open ssh

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    55/60

    CONFIDENTIALDocument Name

    To transfer the public key to aremote machine

    use scp command .

    Open ssh

    Open ssh

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    56/60

    CONFIDENTIALDocument Name

    Create a file named authorized_keys in

    /root/.ssh directory and give full

    permission to the owner for .ssh

    directory .

    Open ssh

    Redirect the public key file

    id_dsa.pub to the authorized_keysfile.

    Open ssh

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    57/60

    CONFIDENTIALDocument Name

    Give read and write permission to

    owner for the file authorized file.

    Open ssh

    Open ssh

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    58/60

    CONFIDENTIALDocument Name

    Now we can access the machine

    192.168.0.21 remotely withoutknowing passwd using public key.

    Open ssh

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    59/60

    CONFIDENTIALDocument Name

  • 8/2/2019 REDHAT 18 Samba Nis Ssh

    60/60

    Thank You!