linux学习

来源:互联网 发布:21天学通c语言电子版 编辑:程序博客网 时间:2024/04/30 08:07

  • Centos系统时间同步

方法一(在Cent 7上亲测可行,cent6.8上不行。systemctl命令不支持cent 6版本

yum install ntp //安装ntp服务
systemctl enable ntpd //开机启动服务
systemctl start ntpd //启动服务
timedatectl set-timezone Asia/Shanghai //更改时区
timedatectl set-ntp yes //启用ntp同步
ntpq -p //同步时间

或者用如下更简单的方法(在cent 6.8上亲测可行,在cent 7上应该也行)

yum install ntp //安装ntp服务

sudo ntpdate time.nist.gov

  • SSH 免密码登陆失败的一种原因,StrictModes

I copied my public key to authorized_keys but public-key authentication still doesn't work.

Typically this is caused by the file permissions on $HOME, $HOME/.ssh or $HOME/.ssh/authorized_keys being more permissive than sshd allows by default.

In this case, it can be solved by executing the following on the server.

chmod go-w $HOME $HOME/.ssh
chmod 600 $HOME/.ssh/authorized_keys
chown `whoami` $HOME/.ssh/authorized_keys
If this is not possible for some reason, an alternative is to set StrictModes no in sshd_config, however this is not recommended.

  • 修改完bashrc后ls,vim等失效问题:

在shell中输入export PATH=/usr/bin:/usr/sbin:/bin:/sbin,暂时可以使用ls,vim等命令。然后打开bashrc,修改path。一般都是写成了export PATH=PATH:XXX,修改成export PATH=$PATH:XXX


  • 建立软连接,将mac固态硬盘上的文件映射到移动硬盘

ln -s /Volumes/exfat/ln_s/net_easy 网易云音乐   #在当前目录下新建一个软连接网易云音乐并将该连接映射到移动硬盘上文件夹/Volumes/exfat/ln_s/net_easy
0 0
原创粉丝点击