Não use nenhum parâmetro relacionado a permissão, especialmente --no-preserve
, porque ele se comporta de forma estranha:
bom:
[il@localhost Downloads]$ sudo cp ssh_host_* /etc/ssh/
[il@localhost Downloads]$ ls -l /etc/ssh
total 604
-rw-r--r-- 1 root root 581843 Oct 20 2017 moduli
-rw-r--r-- 1 root root 2276 Oct 20 2017 ssh_config
-rw------- 1 root root 3907 Oct 20 2017 sshd_config
-rw-r-----. 1 root ssh_keys 227 Oct 2 12:26 ssh_host_ecdsa_key
-rw-r--r--. 1 root root 172 Oct 2 12:26 ssh_host_ecdsa_key.pub
-rw-r-----. 1 root ssh_keys 411 Oct 2 12:26 ssh_host_ed25519_key
-rw-r--r--. 1 root root 100 Oct 2 12:26 ssh_host_ed25519_key.pub
-rw-r-----. 1 root ssh_keys 1679 Oct 2 12:26 ssh_host_rsa_key
-rw-r--r--. 1 root root 392 Oct 2 12:26 ssh_host_rsa_key.pub
ruim:
[il@localhost Downloads]$ sudo cp --no-preserve=mode,ownership ssh_host_* /etc/ssh/
[il@localhost Downloads]$ ls -l /etc/ssh
total 604
-rw-r--r-- 1 root root 581843 Oct 20 2017 moduli
-rw-r--r-- 1 root root 2276 Oct 20 2017 ssh_config
-rw------- 1 root root 3907 Oct 20 2017 sshd_config
-rw-r--r--. 1 root ssh_keys 227 Oct 2 12:27 ssh_host_ecdsa_key
-rw-r--r--. 1 root root 172 Oct 2 12:27 ssh_host_ecdsa_key.pub
-rw-r--r--. 1 root ssh_keys 411 Oct 2 12:27 ssh_host_ed25519_key
-rw-r--r--. 1 root root 100 Oct 2 12:27 ssh_host_ed25519_key.pub
-rw-r--r--. 1 root ssh_keys 1679 Oct 2 12:27 ssh_host_rsa_key
-rw-r--r--. 1 root root 392 Oct 2 12:27 ssh_host_rsa_key.pub