ssh

Paramiko - Bad Authentication Type [Cisco SG-300 Switch]

我只是一个虾纸丫 提交于 2020-06-25 07:05:11
问题 I use the configuration script over the ssh on the following link.The Script is not important, the important thing is that importing parmaiko module. But I added a link: https://github.com/enessanal/NetConfPy/blob/master/netconf.py And related piece of code: import paramiko ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) try: ssh.connect(hostname=host,port=port,username=username,password=password,timeout=timeout) except Exception as exception: print(str

How to execute interactive commands and read their sparse output from Java using JSch

萝らか妹 提交于 2020-06-25 05:35:13
问题 Currently I can use the JSch library to execute remote commands in a SSH session like this: JSch jsch = new JSch(); Session session = jsch.getSession(username, host, 22); session.setPassword(password); Properties config = new Properties(); config.put("StrictHostKeyChecking", "no"); session.setConfig(config); session.connect(); ChannelExec channel = (ChannelExec) session.openChannel("exec"); BufferedReader in = new BufferedReader(new InputStreamReader(channel.getInputStream())); channel

X11 forwarding request failed on channel 0

这一生的挚爱 提交于 2020-06-24 08:24:22
问题 When I do " ssh -X abcserver ", I got message " X11 forwarding request failed on channel 0 ". I checked online and it was suggested to solve it by switching " X11UseLocalhost no " to " X11UseLocalhost yes ". However, both my manager and I don't have this administrative privilege. I am wondering, except this solution, whether there is another option to solve the issue ? I also don't have sudo privilege to directly install X11 on the server. My local platform is: Linux version 3.16.0-4-amd64

How to keep program running in background in ash shell

≡放荡痞女 提交于 2020-06-15 23:42:22
问题 I need to SSH to an embedded device, launch a background program, then disconnect and keep the background process running. The problem is that the embedded device is using the ash shell (NOT bash or anything else), so nohup and screen are NOT available. I have not been able to find any way of disconnecting the process in ash. Is there any way of doing this in ash? 回答1: An alternative to: nohup command & Using clever parentheses: (( command & ) & ) And also if you want to drop stdin/stdout: ((

How to keep program running in background in ash shell

假装没事ソ 提交于 2020-06-15 23:42:15
问题 I need to SSH to an embedded device, launch a background program, then disconnect and keep the background process running. The problem is that the embedded device is using the ash shell (NOT bash or anything else), so nohup and screen are NOT available. I have not been able to find any way of disconnecting the process in ash. Is there any way of doing this in ash? 回答1: An alternative to: nohup command & Using clever parentheses: (( command & ) & ) And also if you want to drop stdin/stdout: ((

How to keep program running in background in ash shell

陌路散爱 提交于 2020-06-15 23:42:10
问题 I need to SSH to an embedded device, launch a background program, then disconnect and keep the background process running. The problem is that the embedded device is using the ash shell (NOT bash or anything else), so nohup and screen are NOT available. I have not been able to find any way of disconnecting the process in ash. Is there any way of doing this in ash? 回答1: An alternative to: nohup command & Using clever parentheses: (( command & ) & ) And also if you want to drop stdin/stdout: ((

SSH to EC2 instance using boto on private IP through bastion server

家住魔仙堡 提交于 2020-06-15 10:10:15
问题 I am trying to execute some bash script on EC2 instance using boto . Boto provides a way SSH to EC2 instance on public IP but in my case the instances have only private IP. The way SSH is done on these instance is using a host which can SSH on all the instance using private IP (Bastion host). Following is the script to connect to instance on public IP: s3_client = boto3.client('s3') s3_client.download_file('mybucket','key/mykey.pem', '/tmp/mykey.pem') k = paramiko.RSAKey.from_private_key_file

ssh not recognized as a command when executed from python using subprocess?

為{幸葍}努か 提交于 2020-06-15 04:26:26
问题 This is my code - import subprocess import sys HOST="xyz3511.uhc.com" # Ports are handled in ~/.ssh/config since we use OpenSSH COMMAND="uptime" ssh = subprocess.Popen(["ssh", "%s" % HOST, COMMAND], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) result = ssh.stdout.readlines() if result == []: error = ssh.stderr.readlines() print (sys.stderr, "ERROR: %s" % error) else: print (result) and this is the error I'm getting- ERROR: [b"'ssh' is not recognized as an internal or external

Is it possible to run multiple command with remote command option in putty?

我是研究僧i 提交于 2020-06-13 09:18:59
问题 I want to run multiple commands automatically like sudo bash, ssh server01, ls , cd /tmp etc at server login.. I am using Remote command option under SSH in putty. I tried multiple commands with delimiter && but not working. 回答1: There is a some information lacking in your question. You say you want to run sudo bash , then ssh server01 . Will sudo prompt for a password in your remote server? Assuming there is no password in sudo, running bash will open another shell waiting for user input.

Is it possible to run multiple command with remote command option in putty?

瘦欲@ 提交于 2020-06-13 09:18:39
问题 I want to run multiple commands automatically like sudo bash, ssh server01, ls , cd /tmp etc at server login.. I am using Remote command option under SSH in putty. I tried multiple commands with delimiter && but not working. 回答1: There is a some information lacking in your question. You say you want to run sudo bash , then ssh server01 . Will sudo prompt for a password in your remote server? Assuming there is no password in sudo, running bash will open another shell waiting for user input.