
Use SSH to Connect TensorboardX
使用ssh作为命令行远程工具,启动远程的tensorboardx并且在本地的浏览器中打开。
远程运行:
1 | tensorboard --logdir <path> --port 6006 |
本地运行:
1 | ssh -N -f -L localhost:16006:localhost:6006 bohan@10.11.16.146 |
Use SSH to Connect TensorboardX
使用ssh作为命令行远程工具,启动远程的tensorboardx并且在本地的浏览器中打开。
远程运行:
1 | tensorboard --logdir <path> --port 6006 |
本地运行:
1 | ssh -N -f -L localhost:16006:localhost:6006 bohan@10.11.16.146 |
Use SSH to Connect Jupyter-lab
使用ssh作为命令行远程工具,启动远程的jupyter lab并且在本地的浏览器中打开。
远程运行:
1 | jupyter lab --no-browser --port=8080 |
--no-broswer
is very important
output:
1 | ... |
本地运行:
1 | ssh -L 8080:localhost:8080 bohanfeng@192.168.2.102 |
本地浏览器访问:
http://127.0.0.1:8080/lab?token=0061d1eb31396b1bc3cd77a7161b2084da1dedcdeca0600c
SSH (Secure Shell) is a network security protocol that provides secure access and file transfer through encryption and authentication mechanisms. It encrypts and verifies network data to provide secure login and other secure network services.
SSH uses a combination of public and private keys to secure communication. The public key is used to encrypt data, while the private key is used to decrypt data. This ensures that even if data is intercepted during transmission, attackers cannot decrypt it, ensuring data security.
An SSH agent is a program that stores private keys and can help you avoid having to enter your passphrase every time you use SSH. When you add a private key to an SSH agent, you only need to enter the passphrase the first time you use the key. After that, the SSH agent will automatically provide the private key for you.
You can use the ssh-keygen
tool to generate a new SSH key pair. Here’s an example of how to use ssh-keygen
to generate an RSA key pair:
1 | ssh-keygen -t rsa -b 4096 -C “your_email@example.com” |
In this command:
-t rsa
specifies the type of key to create. In this case, we’re creating an RSA key.-b 4096
specifies the number of bits in the key. In this case, we’re creating a 4096-bit key.-C "your_email@example.com"
adds a comment to the key. This can be any text you like, but it’s common to use your email address.After running this command, ssh-keygen
will prompt you for a location to save the key pair and for a passphrase to secure the private key. You can accept the default location by pressing Enter, or you can specify a different location if you prefer. If you don’t want to use a passphrase, you can leave it blank by pressing Enter.
On Ubuntu, you can add a key to the ssh-agent
by following these steps:
ssh-agent
is running. You can start it by running the eval "$(ssh-agent -s)"
command.ssh-add ~/.ssh/id_rsa
command to add your first key (the one you commonly use) to the ssh-agent
. If your key file is not in the default location (i.e., ~/.ssh/id_rsa
), replace the path in the command with the actual path of your key file.After completing these steps, you have successfully added your first key to the ssh-agent
. Now when you use SSH to connect to a remote server, the ssh-agent
will automatically provide your private key.
On Ubuntu, you can view the keys added to the ssh-agent
by running the ssh-add -l
command. This command lists the fingerprints of all keys in the ssh-agent
.