How to ssh on Debian
2011-09-10 00:00
288 查看
How to ssh on Debian
1. installation
>>> apt-get install ssh
PS: This is a convenient way to install both the OpenSSH client and the OpenSSH sever.
More details: aptitude show ssh
OR:
>>> apt-get install openssh-sever openssh-client
2. Generating public/private key
>>> ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
f5:ce:6e:8c:0c:75:f2:37:6a:17:10:3b:f4:d6:5d:5b root@debX
The key's randomart image is:
+--[ RSA 2048]----+
| |
| o E|
| .. + .=|
| .o.= o.o|
| S. +.+ |
| . o. + |
| o ooo o |
| o.= . |
| o.. |
+-----------------+
OR:
>>> ssh-keygen -t rsa
3. Configure SSH server/client
3.1 Server:
>>> mkdir $HOME/.ssh
>>> cp id_rsa.pub $HOME/.ssh/authorized_keys
PS: $HOME means the $HOME of the remote user
i.e. /home/rugby/
3.2 Client:
>>> mkdir ~/.ssh
>>> scp root@remote:/root/.ssh/id_rsa ~/.ssh/
4. Secure issues
Server:
>>> vi /etc/ssh/sshd_config
Port <Number > 1024>
PermitRootLogin no
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile %h/.ssh/authorized_keys
ChallengeResponeAuthentication no
PasswordAuthentication no
Client(auto-login):
>>> vi ~/.ssh/config
Host <Server Name>
HostName <IP Address>
Port <Number > 1024>
User <Remote User>
5. Get Started
>>> ssh user@host
>>> scp user@host:/path/to/file ./
PS: host means server name, not ip address
1. installation
>>> apt-get install ssh
PS: This is a convenient way to install both the OpenSSH client and the OpenSSH sever.
More details: aptitude show ssh
OR:
>>> apt-get install openssh-sever openssh-client
2. Generating public/private key
>>> ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
f5:ce:6e:8c:0c:75:f2:37:6a:17:10:3b:f4:d6:5d:5b root@debX
The key's randomart image is:
+--[ RSA 2048]----+
| |
| o E|
| .. + .=|
| .o.= o.o|
| S. +.+ |
| . o. + |
| o ooo o |
| o.= . |
| o.. |
+-----------------+
OR:
>>> ssh-keygen -t rsa
3. Configure SSH server/client
3.1 Server:
>>> mkdir $HOME/.ssh
>>> cp id_rsa.pub $HOME/.ssh/authorized_keys
PS: $HOME means the $HOME of the remote user
i.e. /home/rugby/
3.2 Client:
>>> mkdir ~/.ssh
>>> scp root@remote:/root/.ssh/id_rsa ~/.ssh/
4. Secure issues
Server:
>>> vi /etc/ssh/sshd_config
Port <Number > 1024>
PermitRootLogin no
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile %h/.ssh/authorized_keys
ChallengeResponeAuthentication no
PasswordAuthentication no
Client(auto-login):
>>> vi ~/.ssh/config
Host <Server Name>
HostName <IP Address>
Port <Number > 1024>
User <Remote User>
5. Get Started
>>> ssh user@host
>>> scp user@host:/path/to/file ./
PS: host means server name, not ip address
相关文章推荐
- How to Mount a Remote Folder using SSH on Ubuntu(Ubuntu 使用ssh挂载远程目录)
- how to use systemctl on linux(debian)
- How To Run Fully-Virtualized Guests (HVM) With Xen 3.2 On Debian Lenny (x86_64)
- How to set up a simple mail server on Debian in 5 easy steps
- How To Install Git on Debian 7
- How to Setup NFS (Network File System) on RHEL/CentOS/Fedora and Debian/Ubuntu
- How to Setup NFS (Network File System) on RHEL/CentOS/Fedora and Debian/Ubuntu
- How-to Install Nvidia Driver on 2.6.25-2 Debian Kernel
- Linux: How to Enable SSH on Fedora 16
- How To Install Linux, Nginx, MySQL, PHP (LEMP) Stack on Debian 7
- Linux: How to Enable SSH on Fedora 16
- How To Install Linux, Nginx, MySQL, PHP (LEMP) Stack on Debian 7
- How to install and configure Jabber Server (Ejabberd) on Debian Lenny GNU / Linux
- HOW TO INSTALL XEN HYPERVISOR ON DEBIAN 9 “STRETCH” AND DEBIAN 8 “JESSIE” LINUX SYSTEMS
- How To Create a SSL Certificate on Apache for Debian 8 htttps
- How To Install On Debian with Several Codecs
- How to Setup Rsync without password with SSH on UNIX / Linux?
- How to generate an SSH key on Windows using PuTTY?
- How to access ssh terminal in web browser on Linux
- How To Create a SSL Certificate on Apache for Debian 7 |htttps