Wednesday, October 29, 2008

SSH In Linux

SSH In Linux

Packages for ssh at Linux & Starting the service
openssh-server This package is for configuring the ssh at the server pc.
openssh-client This package is for configuring the ssh at the pc that will try to connect to other with that configuration.
We can check with the following command whether the packages are installed or not.
rpm -qa | grep openssh-server
We can install the packages with the following command.
rpm -ivh openssh-server
rpm -ivh openssh-client
Then we have to start the service with the following command
service sshd start
/etc/init.d/sshd start
At Debian we have to install with the following command
apt-get install ssh
At Debian after installing a package, the service starts automatically.
To start the ssh service at any time at Debian we have to use the following command
/etc/init.d/sshd start —- starts the service
/etc/init.d/sshd restart —- restarts the service
/etc/init.d/sshd stop —— stops the service
/etc/init.d/sshd reload —– reloads the service

Breaking root password at Debian

Breaking root password at Debian

Sometimes we may forget the root password. Then we need to login by breaking password. If we do not know how to break it, then we need to reinstall the OS and loose many important data. I want to share one way of breaking password at debian.
While booting you will be prompted some options like debian kernel XXX options. If you does not press any key the OS get boot on its by default type. To break the password you must stop the booting by pressing a key.
1. Then press e to edit
2. then type
boot: Linux init=/bin/sh
and press enter.
3. This will boot OS on run level 1, which wont want any password. Here you will need to mount the following things.
init-2.03# mount -n -o remount,rw /
init-2.03# mount -avt nonfs,noproc,nosmbfs
4. Now you can go to /etc and remove the password. To do so you have to remove root password from /etc/passwd and /etc/shadow. So…..
init-2.03# cd /etc
init-2.03# vi passwd
init-2.03# vi shadow
That’s all. Now restart your OS and you will find that there is no root password. After logging as root just set a new root password.
Hope to hear from you about better procedure of breaking password.
There is another way to break password using knoppix. As far as I know knoppix is also a boot loader s/w that helps us to break root password of linux. But I did not ever break password using knoppix.