Posted by: isaraffee | August 25, 2009

Running sshd as Intermet Superserver

Running sshd as a internet superserver

 

You should either run sshd as a standalone server or as as internet superserver. Not both.

 

To run ssh as a stanalone is simple. Run the following commands:

[root@localhost ~]# cd /etc/init.d/

[root@localhost init.d]# ./sshd start

Starting sshd:                                                  [  OK  ]

 

To ssh into your local machine, type:

[root@localhost init.d]# ssh ismail@192.168.1.100

ismail@192.168.1.100’s password:

Last login: Sun Aug 16 17:17:43 2009 from 192.168.1.100

[ismail@localhost ~]$

 

Now let’s ssh using internet superserver.

 

Firstly stop the sshd  that is currently running as standalone server:

[root@localhost init.d]# cd /etc/init.d

[root@localhost init.d]# ./sshd stop

Stopping sshd:                                                  [  OK  ]

 

After that, do the following:

[root@localhost init.d]# cd /etc/xinetd.d/

[root@localhost xinetd.d]# ls

proftpd-xinetd  rsync  sshd-xinetd  telnet  telnetd-xinetd

 

You will see that there is a sshd-xinetd file which contains the following:

 

# default: off

# description: sshd server, xinetd version. \

# Don’t run the standalone version if you run \

# this.

service ssh

{

        disable = no

        socket_type             = stream

        wait                    = no

        user                    = root

        server                  = /usr/sbin/sshd

        server_args             = -i

        log_on_success          += DURATION USERID

        log_on_failure          += USERID

        nice                    = 10

}

 

Restart the xinetd services:

[root@localhost init.d]# ./xinetd restart

Stopping xinetd                                                 [  OK  ]

Starting xinetd                                                 [  OK  ]

 

Now ssh using user accout ither than root:

[root@localhost init.d]# ssh ismail@192.168.1.100

ismail@192.168.1.100’s password:

Last login: Sun Aug 16 17:21:15 2009 from 192.168.1.100

[ismail@localhost ~]$

 

You are not permitted to ssh into the root account.

You have to set the PermitRootLogin in your /etc/ssh/sshd_config file to yes as shown below:

PermitRootLogin yes

Save and exit the file. You will have to restart the sshd process.

Restart the xinetd services and ssh as root. This time ssh into root account should work.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: