centos的yum源文件管理位置:
/etc/yum.repos.d/
修改后清空缓存,查看是否已经成功
yum clean all
yum makecacheyum list
下面是示例centos-base.repo
cat ~/.ssh/id_rsa.pub | ssh remote_username@server_ip_address "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"
#修改config
vim /etc/ssh/sshd_config
#如果是vim可以用“/”搜以下设置并修改。“:wq”退出
PasswordAuthentication no
ChallengeResponseAuthentication no
UsePAM no
#重启服务
systemctl restart ssh
# -r 为文件夹操作
scp -r /local/file/path/ root@ip:/remote/path/
#将本机文件复制到远程服务器上
scp /home/oracle/news.txt [email protected]:/tmp
# 将远程服务器上的文件复制到本机
scp [email protected]:/usr/local/sin.sh /home/oracle