我需要一些帮助来访问远程 jupyter 笔记本实例
通常,当我尝试访问在我的 Mac 上的远程服务器上运行的 jupyter 笔记本时,我将在终端窗口中编写以下内容来创建隧道
ssh -NL $local_port_number:localhost:$remote_port_number $my_username@$remote_server
之后,我通常可以通过http://localhost:local_port_number访问 jupyter 服务器
我如何在 Windows 上的 Putty 中执行此操作?我知道连接>>ssh>>隧道中有一些选项可以执行此操作,但到目前为止我无法使配置正常工作。
我尝试使用以下代码生成 SSH 密钥
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA");
keyPairGenerator.initialize(2048);
KeyPair keyPair=keyPairGenerator.generateKeyPair();
RSAPublicKey publicKey=(RSAPublicKey)keyPair.getPublic();
RSAPrivateKey privateKey=(RSAPrivateKey)keyPair.getPrivate();
String base64PubKey = Base64.encodeBase64String(publicKey.getEncoded());
ByteArrayOutputStream byteOs = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(byteOs);
dos.writeInt("ssh-rsa".getBytes().length);
dos.write("ssh-rsa".getBytes());
dos.writeInt(publicKey.getPublicExponent().toByteArray().length);
dos.write(publicKey.getPublicExponent().toByteArray());
dos.writeInt(publicKey.getModulus().toByteArray().length);
dos.write(publicKey.getModulus().toByteArray());
String publicKeyEncoded = new String(
Base64.encodeBase64(byteOs.toByteArray()));
String key = "ssh-rsa " + publicKeyEncoded + " ";
System.out.println("Public Key ------");
System.out.println(key);
System.out.println("------------------------------");
System.out.println("Private key");
System.out.println(Base64.encodeBase64(privateKey.getEncoded()));
Run Code Online (Sandbox Code Playgroud)
现在,当我将私钥的内容存储在文件中并尝试使用 putty 验证它时,它说私钥格式无效。
你们能帮我解决这个问题吗?我是如何丢失私钥格式的,所以 putty 无法识别它。
这可能与 putty 无关,但它在那里非常明显:在 putty 中使用 Google 的 Inconsolata 字体(https://fonts.google.com/specimen/Inconsolata)会导致非常高的行间距:

我知道这与字体本身有关,因为使用“Consolas”和其他字体显示了差异。但我只是想知道,是否有人有解决方案在腻子中使用这种非常漂亮的字体?
我正在尝试制作一个 Flask 网络应用程序。每当我关闭腻子时,网站就会停止运行,即使我对代码进行任何更改,如果不再次运行,它也不会反映在网络上。
我希望将C:\Users\myuser\Downloads\SFTP本地 Windows 文件夹中的所有文件上传到远程 SFTP 服务器myfolder目录。
我在 Windows 上运行 sftp 并实现上述目标时遇到多个问题。
以下是我的命令:
C:\putty\psftp.exe -b C:\putty\sftp_commands.txt -l myuser -pw mypass 10.8.44.86
Run Code Online (Sandbox Code Playgroud)
这是我的C:\putty\sftp_commands.txt文件:
mkdir myfolder
cd myfolder
lcd "C:\Users\myuser\Downloads\SFTP"
put "C:\Users\myuser\Downloads\SFTP\*.*"
Run Code Online (Sandbox Code Playgroud)
尽管该文件存在于我的本地 Windows 上,但我收到“无法打开”错误。
C:\Users\myuser\Downloads\SFTP\*.*当我更改为时,这有效C:\Users\myuser\Downloads\SFTP\file1.txt。
C:\Users\myuser\Desktop>C:\putty\psftp.exe -b C:\putty\sftp_commands.txt -l myuser -pw mypass 10.8.44.86
Using username "myuser".
Pre-authentication banner message from server:
| EFT Server Enterprise 7.3.2.8
End of banner message from server
Keyboard-interactive authentication prompts from server:
End of keyboard-interactive prompts from server
Remote …Run Code Online (Sandbox Code Playgroud) 我试图让arduino告诉我的电脑它的继电器状态是什么.由于某种原因,每次发送新字符串时,PuTTY都会离开最后一个文本的水平位置.这使得显示非常难看.
我希望PuTTY看起来像arduino串行管理器.
这是arduino串行管理器的样子

这就是PuTTY的样子

这是我用来从arduino发送到计算机的代码.

据我所知,我可以使用putty通过终端命令 - " putty server_ip -l user_name -pw password " 直接连接服务器,之后无需输入用户名和密码.就像这样,我可以在终端输入' teamviewer ' 来运行teamviewer .但有人能告诉我如何将'Partner Id'和'Password'传递给'teamviewer'命令直接连接它,因为我正在使用putty.
我准备使用Windows的PuTTY开发源代码来创建我自己的客户端应用程序(在这里找到:http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html)但是当我试图编译时PSCP项目(SCP客户端),我收到以下错误:
C:\ work\2015\Putty\windows\version.rc2(18):错误RC2104:未定义的关键字或键名:BINARY_VERSION
我一直在浏览涉及此错误的各种帖子,但没有找到任何有效的方法:
错误RC2104:未定义的关键字或键名:DS_SETFONT:
在这篇文章中,我注意到MSVC的版本已经提出,所以我想可能需要做些什么来让PuTTY在VC 6.0上运行?
另外我试图添加#include <windows.h>version.rc2(version.rc2用于包含在所有.rc文件中)和pscp.rc,没有用.
如果您需要任何信息(项目属性,源代码......),我会很快回答
在Windows 8.1上使用Visual Studio 6.0和SP6
我正在尝试学习ncurses为我的程序添加一些功能但是我似乎无法将我的终端设置设置为默认的ncurses窗口边框按预期显示的点.
这是我得到的带有框边框的窗口的输出:
lqqqqqqqqk
x x
x x
x x
mqqqqqqqqj
Run Code Online (Sandbox Code Playgroud)
但是我应该得到这个:
??????????
? ?
? ?
? ?
??????????
Run Code Online (Sandbox Code Playgroud)
我能找到的唯一解决这个问题的方法是将我的PuTTY删除字符集设置为Latin-1而不是UTF-8,但是这会混淆我的所有其他应用程序,包括VIM.
我找到了一些相关的SO问题(1和2)但是他们的解决方案都没有帮助我.我从第二个中删除的唯一有趣的事情是,如果我printf '\342\224\224\342\224\200\342\224\220'在命令行中运行它会打印出来???(这是正确的......).
这是我用来测试这个的简单程序:
#include <iostream>
#include <ncurses.h>
#include <string>
#include <cstring>
int main() {
WINDOW *my_win;
int startx, starty, width, height;
int ch;
initscr();
cbreak();
keypad(stdscr, TRUE);
refresh();
int height = 5;
int width = 10;
my_win = newwin(height, width, 1, 2);
box(my_win, 0, 0);
wrefresh(my_win);
getch();
endwin();
return 0;
}
Run Code Online (Sandbox Code Playgroud)
我有什么想法可能做错了吗?谢谢!
我正在使用PuTTY pscp将项目文件夹传输到AWS实例.
我能够使用.ppk公钥文件连接并ssh成功打开并登录.
这里我使用命令来传输文件夹:
pscp -r -i C:\path-to-my-keys\converted-pem-keys.ppk d:\MyDevelopment\myproj ec2-user@xx.xxx.xxx.xxx:/home/ec2-user/myproj
Run Code Online (Sandbox Code Playgroud)
表明:
pscp: Command not found.
Run Code Online (Sandbox Code Playgroud)
PuTTY文件夹的路径在环境变量中设置.任何的想法?