ssh

linux下让ssh服务开机自动运行

荒凉一梦 提交于 2020-01-24 19:37:54
linux下让ssh服务开机自动运行,可以通过systemctl命令来设置。 1、设置ssh开机自启动 sudo systemctl enable ssh 说明:sudo是提升权限,systemctl是服务管理器,enable是systemctl 的参数,表示启用开机自动运行,ssh是要设置的服务名称。 设置成功后,可以用chkconfig查看一下ssh的开机启动状态 ,on表示已设置开机自启动。 2、ssh禁用开机自启动 sudo systemctl disable ssh 说明:sudo是提升权限,systemctl是服务管理器,disable是systemctl 的参数,表示禁止开机运行,ssh是要设置的服务名称。 来源: CSDN 作者: sunke1111 链接: https://blog.csdn.net/sunke1111/article/details/104080045

SSH 显示中文乱码

拜拜、爱过 提交于 2020-01-24 15:25:07
在终端执行命令: export LC_ALL=zh_CN.GB2312;export LANG=zh_CN.GB2312是最有效的。 ======================= 1.不管用那种ssh客户端,字体设定一定要设为可以显示中文的字体。 2.远程的locale一定要设置为LANG=zh_CN.UTF-8 ======================================== 修改/etc/profile 增加这一行 export LC_ALL=zh_CN.GBK ======================================== SSH显示中文乱码问题 (1) 打开/etc/sysconfig/i18n 设置为: LANG="zh_CN.GB2312" LANGUAGE="zh_CN.GB18030:zh_CN.GB2312:zh_CN" SUPPORTED="zh_CN.GB18030:zh_CN.GB2312:zh_CN.UTF-8:zh:en_US.UTF-8:en_US:en:ja_JP.UTF-8:ja_JP:ja" SYSFONT="lat0-sun16" SYSFONTACM="8859-15" 其中LANG="zh_CN.GB2312" 是必须的(如果你不想让中文乱码的话!!!) 其它的可以按照自已的需求来改变。 (2)

C: can I forward port for external application with libssh?

拟墨画扇 提交于 2020-01-24 12:06:45
问题 I'm implementing VNC connection for xen VM in my app. In order to connect I have to forward the port as XenServer accept only local connection. I do it like this: ssh -L 5903:localhost:5903 root@192.168.1.4 After it a can connect my VNC to localhost with corresponding port. But I have to frequently reconnect to different hosts, and using bash is not a good idea as I have a windows build also. Installing ssh-client is not always possible. I read http://api.libssh.org/stable/libssh_tutor

C: can I forward port for external application with libssh?

自闭症网瘾萝莉.ら 提交于 2020-01-24 12:06:12
问题 I'm implementing VNC connection for xen VM in my app. In order to connect I have to forward the port as XenServer accept only local connection. I do it like this: ssh -L 5903:localhost:5903 root@192.168.1.4 After it a can connect my VNC to localhost with corresponding port. But I have to frequently reconnect to different hosts, and using bash is not a good idea as I have a windows build also. Installing ssh-client is not always possible. I read http://api.libssh.org/stable/libssh_tutor

Source a script remotly via ssh

限于喜欢 提交于 2020-01-24 10:46:57
问题 I want to run a remote program via ssh which requires a certain environment. Thus before executing the program I source a specific file building up the environment. If I'm logged onto the machine directly this is no problem but when I execute the command via ssh #!/bin/bash foo=`ssh user@host "source ~/script.sh; ~/run/program"` I get an error that indicates that the script was not sourced correctly. Do you know what I have to do in order to get the script sourced and the program executed in

Why no pure Python SSH1 (version 1) client implementations?

若如初见. 提交于 2020-01-24 10:44:07
问题 There seem to be a few good pure Python SSH2 client implementations out there, but I haven't been able to find one for SSH1. Is there some specific reason for this other than lack of interest in such a project? I am fully aware of the many SSH1 vulnerabilities, but a pure Python SSH1 client implementation would still be very useful to those of us who want to write SSH clients to manage older embedded devices which only support SSH1 (Cisco PIX for example). I also know I'm not the only person

Heredoc for nested command in bash

强颜欢笑 提交于 2020-01-24 10:34:05
问题 I need to ssh into a machine and execute a bunch of commands under sudo bash . Here is what I've tried: sshpass -p "vagrant" ssh vagrant@33.33.33.100 "sudo bash -i -c <<EOF echo ls echo EOF" But it throws me 'bash: -c: option requires an argument\n' . How can I fix this? 回答1: You need to remove -c from your command line to make it accept heredoc: sshpass -p "vagrant" ssh vagrant@33.33.33.100 "sudo bash <<EOF echo ls echo EOF" Also you may remove -i (interactive) option too. bash -c expects

Using SSH, what is the best way to remotely execute a perl file from another perl file and pass arguments that contain spaces?

眉间皱痕 提交于 2020-01-24 09:44:07
问题 Here is what I have- A CGI script on server A gets the parameters entered in a webform, creates a remote ssh command that calls another perl file on server B and passes all parameters as arguments to the ash command. Perl file on server B parses arguments n operates thereafter. Now since I won't have all parameters populated at all times, I am passing a character such as "=" appended to each parameter from CGI on server A and before processing on Server B, I chop that last character which is

Git SSH公钥配置

廉价感情. 提交于 2020-01-24 07:32:47
首先下载安装git: https://git-scm.com/downloads/ 一路默认,安装完成后,打开文件夹C:\Users\Administrator\.ssh(Administrator是当前用户名),在空白处点鼠标右键选择“Git Bush Here” ,打开gitbush。 配置用户名和邮箱: $ git config --global user.name "your_name" $ git config --global user.email "your_email@example.com" 生成密钥对: ssh-keygen -t rsa -b 4096 -C "your_email@example.com" 此时文件夹中会生成两个密钥文件: 打开id_rsa.pub,将文件内容全选复制,准备粘贴到github上: 登陆github,点击右上角头像,选择Settings,选择SSH and GPG keys: 点击“New SSH key”,将复制的密钥内容粘贴进Key的输入框,Title随便取: 回到gitbush,测试输入: ssh -T git@github.com 如果遇到 yes/no 的选项,输入yes。最后看到 “Hi ....”表示设置成功。 来源: CSDN 作者: 添码星空 链接: https://blog.csdn.net/tectrol

ubuntu git的安装更新及配置

大憨熊 提交于 2020-01-24 06:36:14
安装及配置 参考地址: http://blog.csdn.net/qq_26990831/article/details/51857399 1.git 安装 sudo apt-get install git 2.配置本机git的两个重要信息,user.name和user.email git config --global user.name "Your Name" git config --global user.email "email@example.com" 然后我们可通过命令 git config --list,查看是否设置成功 3. 查看home目录下是否有.ssh目录或者home目录下的ubuntu目录下是否有 .ssh目录,如果没有的话需要下面命令来生成git的ssh key ssh-keygen -t rsa -C "youremail@example.com" 然后一直回车就可以了 4.在github上面要添加 .ssh的公钥 cd /home/ubuntu/.ssh             //如果没有找到.ssh 可以尝试在 /root/.ssh/下面找到 id_rsa.pub cat id_rsa.pub 然后将这个文件中的内容添加到github上的添加公钥的地方即可 git更新版本 参考地址: http://www.cnblogs.com