Saturday, 19 March 2011

ssh defined for one user



Configure ssh:
1.goto: vim /etc/ssh/sshd_config
   port 22315
   PermitRootLogin  on

2.goto root: $useradd ragul //username
             $passwd  ragul 
New password:
 re-type password:

3.Type :$vim sudoers
  copy line "root all=(all)"
and paste-edit to "ragul all=(all)".This creats a user "ragul"
with root permission. 

4.Disable ssh login for others,to allow only for our login goto:
$vim /etc/hosts.allow
 EDIT:
 $ssh:192.168.2.158 //type your IP address

5.Restart sshd service :
 $service sshd restart

6.Open another terminal and then type:
 $ ssh -l root 192.168.2.158 -p 22315 //last is port no.
 ->output: Permission denied

7.$ssh -l ragul 192.168.2.158 -p 22315
8.$sudo su

No comments:

Post a Comment