Saturday, May 7, 2011

configuring ssh in Ethernet Switch

Before configuring ssh module in Ethernet switch make sure that ssh modue is installed.

To check ssh module is installed :

show management

this command shows all the module installed in the Ethernet switch  :
if you find the ssh module not installed.Install it before configuring ssh.

After installing  exsshd module,do the following steps:

1)configure ssh2 keys
this is to generate the ssh2 keys

2)enable ssh2
this is to enable the ssh2 module in Ethernet switch.

3)show configuration exsshd 
This will show the configuration of ssh module installed in Ethernet switch.




Friday, May 6, 2011

For locking a account and unllocking

For Locking the account you can use

passwd -l {username}

For unlocking the account you can use

passwd -u {username}

Once the account is locked no person can login to the user via the locked account.

The change can be noticed in /etc/shadow's fie for the locked account.

The account can  be locked only by the superuser or any user with that  privelage.

For adding a role to a user account

You can use the command

usermod -R adminsecurity  anand

here anand is a user
and adminsecurity is the role added to the user anand

For adding the role to the user,you must be a super user(ROOT).





port 22 connection refused

if this errors while trying ssh
Check sshd daemon is running in the server machine

you can check this by logging into the server machine and trying

ps -ef | grep sshd


if you find the ssh daemon process you check port 22 is used by some other process 


netstat -tupn
or  
chkconfg --list sshd

Wednesday, May 4, 2011

Setting up your own ip address for the interface card

You can use set any ip-address for your IP-address
ifconfig  interface IP-address netmask 255.255.255.0 broadcast 192.168.10.255

ifconfig eth2 192.168.10.12 netmask 255.255.255.0 broadcast 192.168.10.255


For bringing up interface use
ifconfig eth2 up

For bringing down the interface use
ifconfig eth2 down




striicthostkeychecking in ssh

Stricthostkey option in ssh

this can be configured in /etc/ssh/ssh_config  or it can be given in the command mode by specifying
ssh -o StrictHostKeyChecking=no 123.33.44.45
        

no option:  in this case when stricthostkey option is set to no:
1)when host key for the connecting server is not in the $HOME/.ssh/known_hosts file,it is added to the file after asking the confirmation from the server.
2)when there is a host key mismatch,it simply connects after showing a warning.
3)not advisable as security is very low.

ask option is the default option:
1)In this case also,when host key for the connecting server is not in the $HOME/.ssh/known_hosts file,it is added to the file after asking the confirmation from the server
2)But when there is a host key mismatch,it denies the connection showing the place where the mismatch has happened.

on option:
1)it is the strictest mode and unfriendliest mode..
2)In this case,when host key for the connecting server is not in the $HOME/.ssh/known_hosts file it simply denies the connection.
2) when there is a host key mismatch,it denies the connection.

Monday, May 2, 2011

host-key mismatch error in ssh

Solution:
This error happens because the privatewtho key in server side and public key in client side is not matching.This is how  public key authentication happens in ssh.

If you want to ssh without key based authentication you can
1) first make the strictHostKeyChecking in your /etc/ssh/ssh_config to no
2)and then remove the particular host key of the server you are trying to ssh from the /etc/ssh/known_hosts file

NOW THE SSH WILL HAPPEN THOUGH WITHOUT MUCH SECURITY.

To ssh with security,you can follow the steps in the blog for public key authentication.