在putty Release 6.0基础上针对ssh登录,修改为保存密码,自动登录(近似)
来源:互联网 发布:java浏览器兼容问题 编辑:程序博客网 时间:2024/05/30 04:52
仅供参考,后果自负-_-
1、安装VS2003,下载putty Release 6.0(http://www.putty.nl/download.html)的源码。
2、在putty.h的struct config_tag中添加变量
在char username[100];这行的下面添加:
char password[100];
3、修改settings.c,将变量写入、读出注册表。
在write_setting_s(sesskey, "UserName", cfg->username);这行下面添加:
write_setting_s(sesskey, "password", cfg->password);
在gpps(sesskey, "UserName", "", cfg->username, sizeof(cfg->username));下面添加:
gpps(sesskey, "password", "", cfg->password, sizeof(cfg->password));
4、在config.c添加用于输入密码的控件
在
/*
* A sub-panel Connection/Data, containing options that
* decide on data to send to the server.
*/
if (!midsession) {
后面添加:
c = ctrl_editbox(s, "Auto-login password", 'w', 50,
HELPCTX(connection_password),
dlg_stdeditbox_handler, I(offsetof(Config,password)),
I(sizeof(((Config *)0)->password)));
c->editbox.password = 1; //设置该ctrl_editbox不为明文。输入的字符以*代替。
5、修改ssh.c,使保存的密码生效
共需要修改两个地方:
(1)用于交互式,使用solaris10测试
大约添加在7500行的
/*
* Send the responses to the server.
*/
前面。
(2)非交互式,使用RedHat AS4测试
大约添加在7573行的
在
/*
* Squirrel away the password. (We may need it later if
* asked to change it.)
*/
与
s->password = dupstr(s->cur_prompt->prompts[0]->result);
free_prompts(s->cur_prompt);
之间。
下面是需要添加的内容:
////////////////////////////////////////////////////////////////////////////////////////
if (ssh->cfg.password[0] != '/0'&& !strcmp("123",s->cur_prompt->prompts[0]->result))
{
strcpy(s->cur_prompt->prompts[0]->result, ssh->cfg.password);
}
////////////////////////////////////////////////////////////////////////////////////////
6、登录方法
在设置界面的Connection->Data输入用户名、密码。
登录后,输123,即可登录系统。当然改为其它的都可以。
////////////////////////
本次实现, 参考http://blog.csdn.net/wwwsq/archive/2007/07/27/1712827.aspx
1、安装VS2003,下载putty Release 6.0(http://www.putty.nl/download.html)的源码。
2、在putty.h的struct config_tag中添加变量
在char username[100];这行的下面添加:
char password[100];
3、修改settings.c,将变量写入、读出注册表。
在write_setting_s(sesskey, "UserName", cfg->username);这行下面添加:
write_setting_s(sesskey, "password", cfg->password);
在gpps(sesskey, "UserName", "", cfg->username, sizeof(cfg->username));下面添加:
gpps(sesskey, "password", "", cfg->password, sizeof(cfg->password));
4、在config.c添加用于输入密码的控件
在
/*
* A sub-panel Connection/Data, containing options that
* decide on data to send to the server.
*/
if (!midsession) {
后面添加:
c = ctrl_editbox(s, "Auto-login password", 'w', 50,
HELPCTX(connection_password),
dlg_stdeditbox_handler, I(offsetof(Config,password)),
I(sizeof(((Config *)0)->password)));
c->editbox.password = 1; //设置该ctrl_editbox不为明文。输入的字符以*代替。
5、修改ssh.c,使保存的密码生效
共需要修改两个地方:
(1)用于交互式,使用solaris10测试
大约添加在7500行的
/*
* Send the responses to the server.
*/
前面。
(2)非交互式,使用RedHat AS4测试
大约添加在7573行的
在
/*
* Squirrel away the password. (We may need it later if
* asked to change it.)
*/
与
s->password = dupstr(s->cur_prompt->prompts[0]->result);
free_prompts(s->cur_prompt);
之间。
下面是需要添加的内容:
////////////////////////////////////////////////////////////////////////////////////////
if (ssh->cfg.password[0] != '/0'&& !strcmp("123",s->cur_prompt->prompts[0]->result))
{
strcpy(s->cur_prompt->prompts[0]->result, ssh->cfg.password);
}
////////////////////////////////////////////////////////////////////////////////////////
6、登录方法
在设置界面的Connection->Data输入用户名、密码。
登录后,输123,即可登录系统。当然改为其它的都可以。
////////////////////////
本次实现, 参考http://blog.csdn.net/wwwsq/archive/2007/07/27/1712827.aspx
- 在putty Release 6.0基础上针对ssh登录,修改为保存密码,自动登录(近似)
- 修改PuTTY实现保存密码自动登录
- Putty保存密码,自动登录
- 修改SSH登录密码
- Putty在Open SSH服务器上的自动登录
- PuTTY SSH 使用证书免密码登录
- Linux SSH 客户端保存密码 自动登录服务端
- Redhat+putty的ssh之自动登录
- putty 使用密钥自动登录 ssh
- putty 使用密钥自动登录 ssh
- putty自动登录ssh的问题
- Linux-Putty通过SSH自动登录设置
- PuTTY免输密码自动登录Linux
- ssh登录自动输密码
- putty 自动登录
- Putty自动登录Linux
- putty自动登录
- putty自动登录
- SVG 走向 Linux 桌面之路
- 生成SVG的工具
- 基于SVG的地图符号设计与实现
- 一种基于空间数据库和SVG的高速Web电子地图的生成及应用方法
- 发现一个SVG做的地图网站:ChinaQuest
- 在putty Release 6.0基础上针对ssh登录,修改为保存密码,自动登录(近似)
- 控件自适应窗口大小
- 2008全国计算机等级考试调整方案
- GPU
- 本blog停止更新,转移
- 转来的Crystal Report制作
- 123
- 经典情歌Lionel Richie李昂纳尔·里奇 - hello -say you say me
- div+css - 工具 - The W3C Markup Validation Service: - W3C标记较验服务