Saturday, October 16, 2010

ssh and localhost

server
/etc/init.d/ssh restart
/etc/ssh/sshd_conf
PermitRootLogin no

#RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys

ChallengeResponseAuthentication no

# Change to no to disable tunnelled clear text passwords
PasswordAuthentication no

UsePAM no
AllowUsers git

Directory
=========
using adduser ..created user git
using sudo -u git -i ..logged in on the client as git

Permissions
===========
chown -R git:git /home/git/.ssh
chmod 700 /home/git/.ssh
chmod 700 /home/git/.ssh/id_rsa
chmod 700 /home/git/.ssh/id_rsa.pub
chmod 700 /home/git/.ssh/authorized_keys === id_rsa.pub

Debug
=====
/usr/sbin/sshd -d -p 54321
ssh -p 54321 -v git@localhost

Client
======
/etc/ssh/ssh_conf

No comments:

Post a Comment