## Update the installed packages and package cache on your instance.
sudo yum update -y
## Install the most recent Docker Community Edition package.
sudo yum install docker
## Check docker version
## Add the ec2-user to the docker group so you can execute Docker commands without using sudo.## Exit the terminal and re-login to make the change effective
sudo usermod -a -G docker ec2-user
exit## Enable docker service
sudo systemctl enable docker
## Start docker service
sudo systemctl start docker
## Check the Docker service.
sudo systemctl status docker
Encountered: $ sudo service ssh --full-restart * Stopping OpenBSD Secure Shell server sshd [ OK ] * Starting OpenBSD Secure Shell server sshd sshd: no hostkeys available -- exiting. Run ssh-keygen -A In the /etc/ssh/ folder, and then restart the server by: $ sudo service ssh --full-restart * Stopping OpenBSD Secure Shell server sshd [ OK ] * Starting OpenBSD Secure Shell server sshd [ OK ]
mv is the wrong tool for this job; you want cp and then rm . Since you're moving the file to another filesystem this is exactly what mv is doing behind the scenes anyway, except that mv is also trying to preserve file permission bits and owner/group information. This is because mv would preserve that information if it were moving a file within the same filesystem and mv tries to behave the same way in both situations. Since you don't care about the preservation of file permission bits and owner/group information, don't use that tool. Use cp --no-preserve=mode and rm instead. But if you don't care about the warning, mv actually does move the files before complaining ownership problem.