ssh: connect to host localhost port 22: Connection refused 问题解决
问题描述:centos7 服务器出现ssh经常掉线,git拉取代码,上传出现ssh: connect to host localhost port 22: Connection refused 错误,同时还会报“Write failed: Broken pipe” 错误。
解决:思路如下:
首先【service sshd status】检查ssh服务启动没。
然后【netstat -nlap | grep ":22"】检查端口启动没。
接着【telnet 127.0.0.1 22】看看本地能连上不。
然后看看防火墙有没有启动,以及有没有开放sshd的tcp22端口。老版本的命令是【service iptables status】,请自行搜索新版本命令。
最后去客户机上ping一下这台服务器看看能否ping通,如果禁ping那就只能做【telnet 服务器IP 22】了。
如果都通了,还要去服务器上检查一下sshd是否设置了开机启动。老版本的命令是【chkconfig --lish | grep sshd】,请自行搜索新版本命令。如果都是off那就【chkconfig sshd on】。
最后检测出来是ip地址冲突导致,因为ping到windows系统是一般是128,linux系统一般是64
参考:
https://www.zhihu.com/question/47897094/answer/108152381?group_id=731288531665682432#comment-146036784
2016年6月28日星期二
2016年6月16日星期四
2015年12月30日星期三
查看ubuntu是32位还是64位系统
查看ubuntu是32位还是64位系统
checkout Ubuntu OS is 32bit or 64bit?
function1:click top right and see "about this computer"
function2:In terminal enter: $uname -a
function3:In terminal enter: $getconf LONG_BIT
information:
http://webcache.googleusercontent.com/search?q=cache:Avc0R8X3NGEJ:https://blog.linuxeye.com/303.html+&cd=2&hl=zh-TW&ct=clnk&gl=us
checkout Ubuntu OS is 32bit or 64bit?
function1:click top right and see "about this computer"
function2:In terminal enter: $uname -a
function3:In terminal enter: $getconf LONG_BIT
information:
http://webcache.googleusercontent.com/search?q=cache:Avc0R8X3NGEJ:https://blog.linuxeye.com/303.html+&cd=2&hl=zh-TW&ct=clnk&gl=us
2015年6月30日星期二
Linux分区指南
Linux分区指南
常用分区
/boot 内核启动文件
/
/home 用户所在目录。大小取决于有多少用户
/user 存放软件
/var/log 系统日志
/tmp 临时文件
/bin 存放标准系统实用程序
/dev 存放设备文件
/opt 存放可选安装软件
/sbin 存放标准文件管理系统
实例分区
120G固态硬盘,用于安装服务器
|
目录
|
容量
|
分区类型
|
|
/boot
|
200M
|
primary
|
|
/
|
60g
|
primary
|
|
/home
|
27.8g
|
primary
|
|
Swap
|
32g
|
logical
|
2014年5月14日星期三
cts测试失败 android.dreams
cts测试失败 android.dreams (1项)
应客户要求,要在我们MR601上过ANDROID 4.4.2的CTS测试,现测试发现
android.dreams
1项不过。
testDreamManagerExists fail junit.framework.AssertionFailedError: Dream manager service missing at android.service.dreams.cts.DreamsFeatureTest.testDreamManagerExists(DreamsFeatureTest.java:30)
修改:
frameworks\base\core\res\res\values\config.xml
<!-- Is the dreams feature supported? Elink_liaobz modify 2013-12-23 -->
<bool name="config_dreamsSupported">false</bool>
应客户要求,要在我们MR601上过ANDROID 4.4.2的CTS测试,现测试发现
android.dreams
1项不过。
testDreamManagerExists fail junit.framework.AssertionFailedError: Dream manager service missing at android.service.dreams.cts.DreamsFeatureTest.testDreamManagerExists(DreamsFeatureTest.java:30)
修改:
frameworks\base\core\res\res\values\config.xml
<!-- Is the dreams feature supported? Elink_liaobz modify 2013-12-23 -->
<bool name="config_dreamsSupported">false</bool>
linux服务器新建用户命令
服务器:
新建用户
sudo useradd test
sudo gpasswd -a test admin
sudo passwd test(设置密码)
sudo vi /etc/passwd(将/bin/sh改为/bin/bash)
test:x:1000:1000::/home/test:/bin/sh -> test:x:1000:1000::/home/test:/bin/bash
在/home目录下新建用户文件夹,需与/etc/passwd中指定的一致
cd /home
sudo mkdir test
sudo chown test:test test/ -R
sudo chown yhg:yhg yhg
建立sbama用户
sudo smbpasswd -a test (输入密码)
sudo vi /etc/samba/smb.conf
(在底部添加以下内容)
[czy]
path = /home/czy
browseable = yes
writable = yes
valid user = czy
这个改变直到你使用 service smbd restart 命令重启 Samba 守护进程后才会生效
sudo /etc/init.d/smbd restart
udo chown yhg:yhg yhg //修改权限
sudo /etc/init.d/smbd restart //重启smbd
sudo ln -s /mnt/hd3 yhg //软连接
sudo chmod 777 . //修改权限
cp ../elinktek4/.profile ../elinktek4/.bashrc ../elinktek4/.bash_logout . //拷贝系统命令
2014年4月19日星期六
修改平板rom之开机logo
今天是新公司上班第三天,学会了修改平板開機logo,記錄如下:
1.
進入git
//下载代码
2.
repo init -u
elink-code-server@192.168.2.96:/elink_code/sda/mr12/manifest.git
repo sync
3.
repo start mtk --all //建立mtk分支
4.
repo forall -c "git
checkout -b elink_sw mr12/elink_sw"
//获取elink_sw分支
5.
repo forall -c "git
checkout -b LBD_MC706_ZX elink_sw" //基于elink_sw分支创建客户分支名为LBD_MC706_ZX
6.
//修改开机logo:
在 Z:\wpdemo\alps\mediatek\config\mr706\elink\MR7063H1C2W1\ProjectConfig.mk 下查找到BOOT_LOGO=wsvga
7.
然后在Z:\wpdemo\alps\mediatek\custom\common\lk\logo\wsvga下修改文件kernel.bmp(开机显示logo)和uboot.bmp(注意使用图片必须使用600*1024分辨率的24位的bmp图片)
//编译代码命令:
8.
./make_user_project.sh R321 mr706 MR7063H1C2 new
// (R321---第一位:R3表示DDR3,R2表示DDR2----第二位:表示片选----第三位:1表示1g,2表示521m 3表示1024,MR7063H1C2表示平板型号)
9.
编译大概1h10min,然后提示在 out/target/product/mr706/system.img 目录下生成刷机文件表示编译成功
10.
接下来使用编译工具flash_tool点击Scatter_loading,选择 out/target/product/mr706/路径下的MT6577_Android_Scatter_emmc.txt文件
11.
点击donwload,平板关机,然后插入数据线连接电脑,开始刷机
12.
刷机完成提示Download OK
13.
./make_user_project.sh R221 mr706 MR7063H1C2W1 systemimage //如果需重新编译使用这条命令,重新编译大概8分钟
订阅:
博文 (Atom)

