SSH and SecureCRT

1. Environment
Ubuntu Server 10.10
SecureCRT 6
OpenSSH 5.3


2. OpenSSH Installations
[codesyntax lang=”bash” lines=”no” container=”pre” tab_width=”4″]

$ sudo apt-get install openssh-server openssh-client
$ sudo vi /etc/ssh/sshd_config

[/codesyntax]

PasswordAuthenitcation, Port 22, Protocol 2,1

[codesyntax lang=”bash” lines=”no” container=”pre” tab_width=”4″]

$ sudo /etc/init.d/sshd restart

[/codesyntax]


3. SecureCRT Configurations
[codesyntax lang=”bash” lines=”no” container=”pre” tab_width=”4″]

$ ifconfig

[/codesyntax]

get your ip addr -> myipaddr

Config your SecureCRT :

Protocol : SSH2

Host : myipaddr

Port : 22

Firewall : none

User : someone

Done and start connection


4. Using RSA with SecureCRT
SecureCRT -> Tools -> Create Pubkey (OpenSSH format)
Upload the public key Identity.pub to server
[codesyntax lang=”bash” lines=”no” container=”pre” tab_width=”4″]

$ su root
$ cd /root
$ mkdir .ssh; chmod 700 .ssh; cd .ssh;
$ mv /path/to/Identity.pub ./authorized_keys2
$ vi /etc/ssh/sshd_config

[/codesyntax]

(optional : to only allow ssh2 rsa auth)

Protocol 2

PubkeyAuthentication yes

AuthorizedKeysFile .ssh/authorized_keys2

PasswordAuthentication no

[codesyntax lang=”bash” lines=”no” container=”pre” tab_width=”4″]

$ sudo /etc/init.d/sshd restart

[/codesyntax]

Use PublicKey when using SecureCRT to connect your server


5. Multi-users with SecureCRT

Upload other user’s Identity.pub to server

[codesyntax lang=”bash” lines=”no” container=”pre” tab_width=”4″]

$ sudo echo `cat /path/to/Identity.pub` >> /root/.ssh/tmp
$ sudo echo `cat /root/.ssh/authorized_keys2` >> /root/.ssh/tmp
$ sudo mv -f /root/.ssh/tmp /root/.ssh/authorized_keys2

[/codesyntax]

To login with another user, set your default path of SecureCRT connection :

SecureCRT -> Global Options -> SSH2 -> PublicKey

Posted in Ubuntu | Tagged , , | Leave a comment