查看进程端口
ps -ef |grep mysqld
netstat -anp | grep 3306
显示电脑以及操作系统的相关信息
uname -a
正在运行的内核版本
cat /proc/version
发行版本信息
cat /etc/issue
比较全的信息
lsb_release -a
find使用用软连接的目录找不到
[root@localhost hbase]# find /usr/local/hbase -name hbase-site.xml
[root@localhost hbase]# find /usr/local/hbase-0.98.14-hadoop1 -name hbase-site.xml
/usr/local/hbase-0.98.14-hadoop1/conf/hbase-site.xml
更新系统时间
ntpdate time-a.nist.gov
修改limits文件
* soft nofile 1048576
* hard nofile 1048576
centos7 sshd 添加或修改端口号之前 要设置selinux 或者关闭selinux后 再重启sshd端口才能生效。
1、禁用SELinux(重启后依然生效)
修改/etc/sysconfig/selinux
更改其中的SELINUX项的值就可以关闭和启用SELinux服务了。
修改成 SELINUX=disable 禁用SeLinux
修改成 SELINUX=enforcing 使用SeLinux
或
vi /etc/selinux/conf
set SELINUX=disabled
2、不重启让其生效
/usr/sbin/setenforce 0 立刻关闭 SELINUX
/usr/sbin/setenforce 1 立刻启用 SELINUX
3,加到系统默认启动里面
echo “/usr/sbin/setenforce 0″ >> /etc/rc.local
echo “/usr/sbin/setenforce 0″ >> /etc/rc.local
//先处理好selinux再重启sshd 新端口才有效
# If you want to change the port on a SELinux system, you have to tell
# SELinux about this change.
# semanage port -a -t ssh_port_t -p tcp #PORTNUMBER
没有semanage命令
yum provides semanage
yum -y install policycoreutils-python
NM_CONTROLLED=no //关键是这个
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.120.106
NETMASK=255.255.255.0
centos7设置hostname
http://www.centoscn.com/CentOS/config/2014/1031/4039.html
hostnamectl status –static
hostnamectl status –transient
hostnamectl status –pretty
//全部修改
hostnamectl set-hostname n1
//部分修改
hostnamectl –static set-hostname
hostnamectl –static set-hostname n1
hostnamectl –transient set-hostname n1
hostnamectl –pretty set-hostname n1
重启机器会看到生效了。
ssh设置了免秘钥登陆,怎么还提示要输入密码:
tail -n 50 /var/log/secure 查看被访问机器的日志
bad ownership or modes for directory
修改权限
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
搞定了。