Windows ssh ubuntu / Linux
2015-11-03 11:04
639 查看
1.ssh的安装
gavin@ubuntu:~$ sudo apt-get install ssh
2.生成密钥
[html] view plaincopyprint?
gavin@ubuntu:~$ ssh-keygen
[plain] view plaincopyprint?
Generating public/private rsa key pair.
Enter file in which to save the key (/home/gavin/.ssh/id_rsa):
Created directory '/home/gavin/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Passphrases do not match. Try again.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/gavin/.ssh/id_rsa.
Your public key has been saved in /home/gavin/.ssh/id_rsa.pub.
The key fingerprint is:
7f:47:de:fd:11:74:af:5c:89:a4:58:48:5d:c0:21:6a gavin@ubuntu
The key's randomart image is:
+--[ RSA 2048]----+
| ooo+. |
| o oo |
| E . . . ..|
| . o o o +|
| S. . ..oo|
| . + +o|
| . . =.o|
| . . o|
| .|
+-----------------+
上述过程会提示输入ssh的登录密码,默认密钥的位置在~/.ssh目录中,这里将公钥改名为authorized_keys
[html] view plaincopyprint?
gavin@ubuntu:~/cd .ssh
gavin@ubuntu:~/.ssh$ mv id_rsa.pub authorized_keys
3.修改配置文件,/etc/ssh/sshd_config
[html] view plaincopyprint?
gavin@ubuntu:~/.ssh$ sudo vi /etc/ssh/sshd_config
......
# AuthorizedKeysFile %h/.ssh/authorized_keys
.....
这里将AuthorizedKeysFile前的#号去掉即可
4.到windows平台,启动Puttygen,导入先前生成的私钥id_rsa,转换成putty所识别的格式(*.ppk),得到文件id_rsa.ppk.
5.windows上启动putty,进行如下配置
Session-Logging-Hostname:填上你的linux的ip
Windows -Translation - 在下拉菜单里选上UTF-8,这里不设置,登录后将会出现中文乱码。
Connection- Data - Auto login username:填上你登录ubuntu时用的用户名。
Connection- SSH-Auth-Private key file for authentication:选上id_rsa.ppk
保存Session配置
6.打开刚刚配置的ssh,成功登录
[html] view plaincopyprint?
Using username "gavin".
Authenticating with public key "imported-openssh-key"
Passphrase for key "imported-openssh-key":
Linux ubuntu 2.6.32-21-generic #32-Ubuntu SMP Fri Apr 16 08:10:02 UTC 2010 i686 GNU/Linux
Ubuntu 10.04 LTS
Welcome to Ubuntu!
* Documentation: https://help.ubuntu.com/
409 packages can be updated.
171 updates are security updates.
Last login: Wed Jul 6 06:05:40 2011 from 192.168.27.112
gavin@ubuntu:~$
7.其它事项
git带有puttygen工具
密钥的生成也可以直接使用puttygen
也可以不使用密钥机制,这样可以直接使用linux的用户名及密码登录
原文地址:/article/2321348.html
1.ssh的安装
gavin@ubuntu:~$ sudo apt-get install ssh
2.生成密钥
[html] view plaincopyprint?
gavin@ubuntu:~$ ssh-keygen
[plain] view plaincopyprint?
Generating public/private rsa key pair.
Enter file in which to save the key (/home/gavin/.ssh/id_rsa):
Created directory '/home/gavin/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Passphrases do not match. Try again.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/gavin/.ssh/id_rsa.
Your public key has been saved in /home/gavin/.ssh/id_rsa.pub.
The key fingerprint is:
7f:47:de:fd:11:74:af:5c:89:a4:58:48:5d:c0:21:6a gavin@ubuntu
The key's randomart image is:
+--[ RSA 2048]----+
| ooo+. |
| o oo |
| E . . . ..|
| . o o o +|
| S. . ..oo|
| . + +o|
| . . =.o|
| . . o|
| .|
+-----------------+
上述过程会提示输入ssh的登录密码,默认密钥的位置在~/.ssh目录中,这里将公钥改名为authorized_keys
[html] view plaincopyprint?
gavin@ubuntu:~/cd .ssh
gavin@ubuntu:~/.ssh$ mv id_rsa.pub authorized_keys
3.修改配置文件,/etc/ssh/sshd_config
[html] view plaincopyprint?
gavin@ubuntu:~/.ssh$ sudo vi /etc/ssh/sshd_config
......
# AuthorizedKeysFile %h/.ssh/authorized_keys
.....
这里将AuthorizedKeysFile前的#号去掉即可
4.到windows平台,启动Puttygen,导入先前生成的私钥id_rsa,转换成putty所识别的格式(*.ppk),得到文件id_rsa.ppk.
5.windows上启动putty,进行如下配置
Session-Logging-Hostname:填上你的linux的ip
Windows -Translation - 在下拉菜单里选上UTF-8,这里不设置,登录后将会出现中文乱码。
Connection- Data - Auto login username:填上你登录ubuntu时用的用户名。
Connection- SSH-Auth-Private key file for authentication:选上id_rsa.ppk
保存Session配置
6.打开刚刚配置的ssh,成功登录
[html] view plaincopyprint?
Using username "gavin".
Authenticating with public key "imported-openssh-key"
Passphrase for key "imported-openssh-key":
Linux ubuntu 2.6.32-21-generic #32-Ubuntu SMP Fri Apr 16 08:10:02 UTC 2010 i686 GNU/Linux
Ubuntu 10.04 LTS
Welcome to Ubuntu!
* Documentation: https://help.ubuntu.com/
409 packages can be updated.
171 updates are security updates.
Last login: Wed Jul 6 06:05:40 2011 from 192.168.27.112
gavin@ubuntu:~$
7.其它事项
git带有puttygen工具
密钥的生成也可以直接使用puttygen
也可以不使用密钥机制,这样可以直接使用linux的用户名及密码登录
gavin@ubuntu:~$ sudo apt-get install ssh
2.生成密钥
[html] view plaincopyprint?
gavin@ubuntu:~$ ssh-keygen
[plain] view plaincopyprint?
Generating public/private rsa key pair.
Enter file in which to save the key (/home/gavin/.ssh/id_rsa):
Created directory '/home/gavin/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Passphrases do not match. Try again.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/gavin/.ssh/id_rsa.
Your public key has been saved in /home/gavin/.ssh/id_rsa.pub.
The key fingerprint is:
7f:47:de:fd:11:74:af:5c:89:a4:58:48:5d:c0:21:6a gavin@ubuntu
The key's randomart image is:
+--[ RSA 2048]----+
| ooo+. |
| o oo |
| E . . . ..|
| . o o o +|
| S. . ..oo|
| . + +o|
| . . =.o|
| . . o|
| .|
+-----------------+
上述过程会提示输入ssh的登录密码,默认密钥的位置在~/.ssh目录中,这里将公钥改名为authorized_keys
[html] view plaincopyprint?
gavin@ubuntu:~/cd .ssh
gavin@ubuntu:~/.ssh$ mv id_rsa.pub authorized_keys
3.修改配置文件,/etc/ssh/sshd_config
[html] view plaincopyprint?
gavin@ubuntu:~/.ssh$ sudo vi /etc/ssh/sshd_config
......
# AuthorizedKeysFile %h/.ssh/authorized_keys
.....
这里将AuthorizedKeysFile前的#号去掉即可
4.到windows平台,启动Puttygen,导入先前生成的私钥id_rsa,转换成putty所识别的格式(*.ppk),得到文件id_rsa.ppk.
5.windows上启动putty,进行如下配置
Session-Logging-Hostname:填上你的linux的ip
Windows -Translation - 在下拉菜单里选上UTF-8,这里不设置,登录后将会出现中文乱码。
Connection- Data - Auto login username:填上你登录ubuntu时用的用户名。
Connection- SSH-Auth-Private key file for authentication:选上id_rsa.ppk
保存Session配置
6.打开刚刚配置的ssh,成功登录
[html] view plaincopyprint?
Using username "gavin".
Authenticating with public key "imported-openssh-key"
Passphrase for key "imported-openssh-key":
Linux ubuntu 2.6.32-21-generic #32-Ubuntu SMP Fri Apr 16 08:10:02 UTC 2010 i686 GNU/Linux
Ubuntu 10.04 LTS
Welcome to Ubuntu!
* Documentation: https://help.ubuntu.com/
409 packages can be updated.
171 updates are security updates.
Last login: Wed Jul 6 06:05:40 2011 from 192.168.27.112
gavin@ubuntu:~$
7.其它事项
git带有puttygen工具
密钥的生成也可以直接使用puttygen
也可以不使用密钥机制,这样可以直接使用linux的用户名及密码登录
原文地址:/article/2321348.html
1.ssh的安装
gavin@ubuntu:~$ sudo apt-get install ssh
2.生成密钥
[html] view plaincopyprint?
gavin@ubuntu:~$ ssh-keygen
[plain] view plaincopyprint?
Generating public/private rsa key pair.
Enter file in which to save the key (/home/gavin/.ssh/id_rsa):
Created directory '/home/gavin/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Passphrases do not match. Try again.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/gavin/.ssh/id_rsa.
Your public key has been saved in /home/gavin/.ssh/id_rsa.pub.
The key fingerprint is:
7f:47:de:fd:11:74:af:5c:89:a4:58:48:5d:c0:21:6a gavin@ubuntu
The key's randomart image is:
+--[ RSA 2048]----+
| ooo+. |
| o oo |
| E . . . ..|
| . o o o +|
| S. . ..oo|
| . + +o|
| . . =.o|
| . . o|
| .|
+-----------------+
上述过程会提示输入ssh的登录密码,默认密钥的位置在~/.ssh目录中,这里将公钥改名为authorized_keys
[html] view plaincopyprint?
gavin@ubuntu:~/cd .ssh
gavin@ubuntu:~/.ssh$ mv id_rsa.pub authorized_keys
3.修改配置文件,/etc/ssh/sshd_config
[html] view plaincopyprint?
gavin@ubuntu:~/.ssh$ sudo vi /etc/ssh/sshd_config
......
# AuthorizedKeysFile %h/.ssh/authorized_keys
.....
这里将AuthorizedKeysFile前的#号去掉即可
4.到windows平台,启动Puttygen,导入先前生成的私钥id_rsa,转换成putty所识别的格式(*.ppk),得到文件id_rsa.ppk.
5.windows上启动putty,进行如下配置
Session-Logging-Hostname:填上你的linux的ip
Windows -Translation - 在下拉菜单里选上UTF-8,这里不设置,登录后将会出现中文乱码。
Connection- Data - Auto login username:填上你登录ubuntu时用的用户名。
Connection- SSH-Auth-Private key file for authentication:选上id_rsa.ppk
保存Session配置
6.打开刚刚配置的ssh,成功登录
[html] view plaincopyprint?
Using username "gavin".
Authenticating with public key "imported-openssh-key"
Passphrase for key "imported-openssh-key":
Linux ubuntu 2.6.32-21-generic #32-Ubuntu SMP Fri Apr 16 08:10:02 UTC 2010 i686 GNU/Linux
Ubuntu 10.04 LTS
Welcome to Ubuntu!
* Documentation: https://help.ubuntu.com/
409 packages can be updated.
171 updates are security updates.
Last login: Wed Jul 6 06:05:40 2011 from 192.168.27.112
gavin@ubuntu:~$
7.其它事项
git带有puttygen工具
密钥的生成也可以直接使用puttygen
也可以不使用密钥机制,这样可以直接使用linux的用户名及密码登录
相关文章推荐
- Linux定时备份Mysql
- linux系统安装到第二块磁盘
- 每天一个linux命令(33):df 命令
- linux 信号处理函数集合
- linux 下 `dirname $0`
- Linux下man帮助命令使用全解析
- Linux开机自动挂载(磁盘)
- Raspbian GNU/Linux 7 配置WIFI 内核4.1.7+
- linux sleep命令
- android CTS SELinuxDomainTest# testInitDomain
- linux下如何删除大量小文件
- Linux系统基本的网络端口操作命令小结
- Linux 目录的读权限和执行权限的区别
- Linux下追踪函数调用,打印栈帧
- CentOS服务器时间同步
- 获得 linux 命令的帮助
- linux互斥锁操作
- kali linux 2.0 metasploit初始设置
- 按时按登录IP记录Linux所有用户操作日志的方法(附脚本)
- Linux-管理netstat lsof