ssh

How can I ssh to google colaboratory VM?

倖福魔咒の 提交于 2020-05-10 04:30:35
问题 How can I ssh to google collaboratory VM? Is there a more straightforward way to do it than to create ssh tunnel from jupyter notebook to a remote server? 回答1: Try pasting the following into a cell and running it (inspired by this gist): import random, string, urllib.request, json, getpass #Generate root password password = ''.join(random.choice(string.ascii_letters + string.digits) for i in range(20)) #Download ngrok ! wget -q -c -nc https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux

shell-init: error retrieving current directory: getcwd — The usual fixes do not wor

喜夏-厌秋 提交于 2020-05-09 21:01:13
问题 I have a simple script: #!/bin/bash for server in $(~/.ansible/ansible_hosts) do ssh $server "hostname; readlink /opt/mydir/mylink;" done It works fine - the program returns the correct hostname and link - except that I get the following error on some but not all of the servers: shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory All the directories exist. One of the most common suggestions has been to add a cd, a cd -, or a cd /

Hadoop “Permission denied (publickey,password,keyboard-interactive)” warning

一曲冷凌霜 提交于 2020-05-09 19:45:11
问题 I am following this tutorial to install Hadoop in my computer. After finishing the installation, when I try to launch Hadoop using this command ./start-dfs.sh , it returns me the following: U:sbin U$ ./start-dfs.sh Starting namenodes on [localhost] localhost: U@localhost: Permission denied (publickey,password,keyboard-interactive). Starting datanodes localhost: U@localhost: Permission denied (publickey,password,keyboard-interactive). Starting secondary namenodes [U.local] U.local: U@pc.local:

access host's ssh tunnel from docker container

限于喜欢 提交于 2020-05-09 18:28:02
问题 Using ubuntu tusty, there is a service running on a remote machine, that I can access via port forwarding through an ssh tunnel from localhost:9999 . I have a docker container running. I need to access that remote service via the host's tunnel, from within the container. I tried tunneling from the container to the host with -L 9000:host-ip:9999 , then accessing the service through 127.0.0.1:9000 from within the container fails to connect. To check wether the port mapping was on, I tried nc

access host's ssh tunnel from docker container

瘦欲@ 提交于 2020-05-09 18:27:49
问题 Using ubuntu tusty, there is a service running on a remote machine, that I can access via port forwarding through an ssh tunnel from localhost:9999 . I have a docker container running. I need to access that remote service via the host's tunnel, from within the container. I tried tunneling from the container to the host with -L 9000:host-ip:9999 , then accessing the service through 127.0.0.1:9000 from within the container fails to connect. To check wether the port mapping was on, I tried nc

How does git know which ssh key to use for its operations?

て烟熏妆下的殇ゞ 提交于 2020-05-09 01:29:39
问题 I have SSH keys in place, inside ~/.ssh . Many of them actually. So I wonder how does git know which one to take when it tries to connect to a repository over git@domain.com:group/repo.git endpoint? 回答1: Git does not know, or care. It just runs ssh. How does ssh know? It looks at your ~/.ssh/config file ( edit : or gets it from ssh-agent; see below): Host github.com # IdentitiesOnly yes # see below to decide if you want this IdentityFile ~/.ssh/github_id_file Host domain.com IdentitiesOnly

How does git know which ssh key to use for its operations?

倾然丶 夕夏残阳落幕 提交于 2020-05-09 01:21:42
问题 I have SSH keys in place, inside ~/.ssh . Many of them actually. So I wonder how does git know which one to take when it tries to connect to a repository over git@domain.com:group/repo.git endpoint? 回答1: Git does not know, or care. It just runs ssh. How does ssh know? It looks at your ~/.ssh/config file ( edit : or gets it from ssh-agent; see below): Host github.com # IdentitiesOnly yes # see below to decide if you want this IdentityFile ~/.ssh/github_id_file Host domain.com IdentitiesOnly

Can I call Channel.invoke_shell() without calling Channel.get_pty() beforehand, when NOT using Channel.exec_command()

℡╲_俬逩灬. 提交于 2020-05-08 17:09:28
问题 I have read Paramiko docs multiple times. Still I am not able to find an answer for question I had: Why can't I call channel.invoke_shell() without calling channel.get_pty() beforehand? – Here is my understanding from the docs – it is not necessary to call channel.get_pty() if I want to use channel.exec_command() . But what if I would like to use an interactive shell with channel.send() or channel.recv() . Is it mandatory? Here is my try: client = paramiko.SSHClient() # Set SSH key parameters

Can I call Channel.invoke_shell() without calling Channel.get_pty() beforehand, when NOT using Channel.exec_command()

核能气质少年 提交于 2020-05-08 17:01:07
问题 I have read Paramiko docs multiple times. Still I am not able to find an answer for question I had: Why can't I call channel.invoke_shell() without calling channel.get_pty() beforehand? – Here is my understanding from the docs – it is not necessary to call channel.get_pty() if I want to use channel.exec_command() . But what if I would like to use an interactive shell with channel.send() or channel.recv() . Is it mandatory? Here is my try: client = paramiko.SSHClient() # Set SSH key parameters

pkill returns 255 in combination with another command via remote ssh

老子叫甜甜 提交于 2020-05-08 04:28:26
问题 When I try to execute pkill on a remote host in combination with another command, it always returns 255, even though both the commands were successful. Examples ssh <remoteHost> 'pkill -f xyz' # returns 0 (rightly so when xyz is a process) ssh <remoteHost> 'source /etc/profile' # returns 0 (rightly so) But when I run the combination command: ssh <remoteHost> 'source /etc/profile; pkill -f xyz' # returns 255 - why? There's something about "pkill" in combination with another command because the