2017年2月1日星期三
2016年6月28日星期二
ssh: connect to host localhost port 22: Connection refused 问题解决
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
问题描述: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月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 . //拷贝系统命令
订阅:
博文 (Atom)

