billchurch / webssh2

Web SSH Client using ssh2, socket.io, xterm.js, and express. webssh webssh2
MIT License
2.26k stars 527 forks source link

我有ip 用户名 密码 怎么自动登录 #352

Closed zhangxiaoyy closed 3 months ago

zhangxiaoyy commented 6 months ago

我想直接跳到这个webssh页面的时候 不用在表单提交用户名密码,我自己已经有用户名和密码的情况下 怎么跳过输入直接登录服务器

dawven commented 6 months ago

https://github.com/billchurch/webssh2/issues/215

@zhangxiaoyy 参考这个,需要在config配置文件里打开overridebasic, 再app.js 文件 // app.use(basicAuth); 注释掉 routes.js的connect方法里 req.session.username = req.query.username; req.session.userpassword = req.query.userpassword;

手动从URL取传过来的username和密码

Please refer to this. You need to open "overridebasic" in the config configuration file. Then, comment out "// app.use(basicAuth);" in the app.js file. In the connect method of routes.js, req.session.username = req.query.username; req.session.userpassword = req.query.userpassword;

Manually retrieve the username and password passed from the URL.