Anda di halaman 1dari 60

Samba configuration

Andrew Tridgell wrote a SMB [server message block] client and server that he called Samba. Samba is a collection of Linux tools that allow you to communicate with windows systems over a network. Helps in browsing the network resources using host names by name resolution instead of DNS. File and printer sharing is probably the most attractive samba feature.

Document Name CONFIDENTIAL

Samba Service Profile

Packages :

samba, samba-common, samba-client

Daemons :

smbd, nmbd (NetBIOS nameserver)

Config file :

/etc/samba/smb.conf

Ports

137 (nmbd), 138(smbd)

Document Name CONFIDENTIAL

Samba configuration

rpm -q queries for the packages installed.

Document Name CONFIDENTIAL

Samba configuration

rpm -ivh along with package name installs the package.

Document Name CONFIDENTIAL

Samba configuration

/etc/samba/smb.conf is the configuration file.

Document Name CONFIDENTIAL

Samba configuration

The smb.conf file is The windows domain openedor the workgroup name now to edit. name can be given.

Document Name CONFIDENTIAL

Samba configuration

This is the default screen showing the default network for accessing.

Document Name CONFIDENTIAL

Samba configuration

The screen shows that the network 192.168.0 and 192.168.1 can access the samba server.

Document Name CONFIDENTIAL

Samba configuration

At the end of the smb.conf file, shows the example of how to share the linux files.

Document Name CONFIDENTIAL

Samba configuration

The tmp directory is shared to public(full access) as well as write the file.

The var directory is given as the user joe only can access the file from any windows operating system.

The previous example is used here as such like tmp and var directory.

Document Name CONFIDENTIAL

Samba configuration

Password is set for accessing from Samba user name and password the windows stored in system. are operating /etc/samba/smbpasswd file.

Document Name CONFIDENTIAL

Samba configuration

The service for the samba configuration is started by restarting.

Document Name CONFIDENTIAL

Samba configuration

smbclient -L shows the shared directory of samba server.

Document Name CONFIDENTIAL

Samba configuration

The user joe gets logged in by giving password for authentication. ls command is used to list the files shared.

This command helps to confirm whether the configuration is done properly.

Document Name CONFIDENTIAL

Samba configuration

The screen viewing the listed files. mget command copy the file from shared directory to our machine.

Document Name CONFIDENTIAL

Samba configuration

testparm command is used to show the shared directory of the samba server.

Hitting enter will show the detailed shared directory.

Document Name CONFIDENTIAL

Samba configuration

Here the screen shows the simulation of the samba configuration.

Document Name CONFIDENTIAL

NIS

files. -

Network information service. NIS stores administrative files in /etc/passwd, /etc/hosts etc., in DB

These Datas are available over the network to

all

clients

that

are

connected to the NIS domain.

NIS

client

daemon

(ypbind)

finds

server

for

its

NIS Domain by sending a broadcast request.

Document Name CONFIDENTIAL

NIS: Service profile


Packages Daemons Config. Files : : : ypserv, ypbind, yp-tools ypserv, ypbind, rpc.yppasswdd /etc/ypserv.conf (server) /var/yp/*,

/etc/sysconfig/network (common)
/etc/nsswitch.conf, (client) /etc/yp.conf Port : 111 (assigned by portmap)
Document Name CONFIDENTIAL

Steps to Configure NIS

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.

Document Name CONFIDENTIAL

NIS Configurations

Query is made to check whether the portmap and ypserv are installed. if not, install the packages

Document Name CONFIDENTIAL

NIS Configurations
To set the nis domain name temporarily, nisdomainname command is used.

To set nis domain name permanently, entries are made at /etc/sysconfig/network.

Document Name CONFIDENTIAL

NIS Configurations

Enter the nis domain name.Here our nis domain is nis

Document Name CONFIDENTIAL

NIS Configurations

Start the portmap and ypserv services.

Document Name CONFIDENTIAL

NIS Configurations

Open the nis configuration file.

Document Name CONFIDENTIAL

NIS Configurations

nopush options is set to true if there is no nis slave server.and it is set to false if there is a slave sever.

Document Name CONFIDENTIAL

NIS Configurations
The minimum user and group Ids are set to 500.

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.

Document Name CONFIDENTIAL

NIS Configurations

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

Document Name CONFIDENTIAL

NIS Configurations
This command create the nis database consisting of the nis configuration file.

Document Name CONFIDENTIAL

NIS Configurations

Open the control access file.

Create a control access file named securents, which enables access by hosts to the nis server.

Document Name CONFIDENTIAL

NIS Configurations

Here we are giving access all the hosts in the network 192.168.0.0 and the localhost.

Document Name CONFIDENTIAL

NIS Configurations

Restart the yppasswdd and ypserv services.

Document Name CONFIDENTIAL

NIS Configurations

This command is used to indicate the nis server.

In client side check for the ypbind package.

Document Name CONFIDENTIAL

NIS Configurations

Select the NIS option and enter the nis domain name and its ip address and press next.

Document Name CONFIDENTIAL

NIS Configurations

Press ok to continue.

Document Name CONFIDENTIAL

NIS Configurations

ypcat lists any NIS configuration file here we can see the password file.

Document Name CONFIDENTIAL

NIS Configurations

ypmatch command is used to view a particular users entry in the configuration file. Open the auto.master file.

Document Name CONFIDENTIAL

NIS Configurations

Enter the mounting directory, here we mount in the /home directory .

Document Name CONFIDENTIAL

NIS Configurations

Open the auto.misc file.

Document Name CONFIDENTIAL

NIS Configurations

Mention the NIS server ip address and the home directory to be mounted.

Document Name CONFIDENTIAL

NIS Configurations

Restart the autofs service .

Document Name CONFIDENTIAL

Secure shell (SSH)

Secure Shell Allows remote logins and remote command execution via secure encrypted connections.

Syntax:

ssh <username>@<hostname>

Document Name CONFIDENTIAL

Secure shell (SSH)

Service for the sshd is restarted.

Document Name CONFIDENTIAL

Secure shell (SSH)

Open the file hosts.allow.

Document Name CONFIDENTIAL

Secure shell (SSH)

example.com specified here, enables the machines under example.com domain can access the remote login.

Document Name CONFIDENTIAL

Secure shell (SSH)

Open the hosts.deny file.

Document Name CONFIDENTIAL

Secure shell (SSH)

sshd : ALL entered above means that except example .com others are restricted to access.

Document Name CONFIDENTIAL

Secure shell (SSH)

Look at the client machine it is available in the example.com domain.

Document Name CONFIDENTIAL

Secure shell (SSH)


From the host satation41 we logged as root in station20.example.com

Document Name CONFIDENTIAL

Open ssh
Open SSH replaces common, insecure network communication skills.

Provides greater data security between networked systems.

Capable of tunneling in secured protocols through forwarding.

Document Name CONFIDENTIAL

Open ssh

Packages

openssh-clients, openssh-server

Daemons

sshd

Config. Files

/etc/ssh/*, $home/.ssh

Port

22

Document Name CONFIDENTIAL

Open ssh

The openssh packages are installed

Document Name CONFIDENTIAL

Open ssh

Service sshd is restarted.

Document Name CONFIDENTIAL

Open ssh
Keygen is used to generate public and private keys using DSA algorithm.

The generated public key is saved in id_dsa.pub file. The generated private key is saved in id_dsa file.

Document Name CONFIDENTIAL

Open ssh

To transfer the public key to a remote machine use scp command .

Document Name CONFIDENTIAL

Open ssh

Create a file named authorized_keys in /root/.ssh directory and give full permission to the owner for .ssh Redirect the public key file directory . id_dsa.pub to the authorized_keys file.

Document Name CONFIDENTIAL

Open ssh

Give read and write permission to owner for the file authorized file.

Document Name CONFIDENTIAL

Open ssh

Now we can access the machine 192.168.0.21 remotely without knowing passwd using public key.

Document Name CONFIDENTIAL

Document Name CONFIDENTIAL

Thank You!

Anda mungkin juga menyukai