AWS

EC2 사용자 데이터

KK_Ryong 2023. 6. 2. 15:25

#!/bin/bash   
sudo su
yum update -y
yum install -y vim
sudo rm -f /etc/localtime
sudo ln -s /usr/share/zoneinfo/Asia/Seoul /etc/localtime

echo -e "\nalias vi='vim'" >> /etc/profile
echo -e "\nexport TMOUT=60000" >> /etc/profile

#all user history
echo -e '\nHISTTIMEFORMAT="%Y-%m-%d_%H:%M:%S: >> "' >> /etc/profile
echo -e "\nexport HISTTIMEFORMAT" >> /etc/profile
echo -e "\nalias ll='ls -al'" >> /etc/profile
echo -e "\nalias cp='cp -i'" >> /etc/profile
echo -e "\nalias mv='mv -i'" >> /etc/profile
echo -e "\nalias df='df -h'" >> /etc/profile
echo -e "\nalias free='free -m'" >> /etc/profile

echo -e "\nalias d='docker'" >>  /etc/profile
echo -e "\nalias dc='docker-compose'" >>   /etc/profile

echo -e '\nHISTTIMEFORMAT="%Y-%m-%d_%H:%M:%S: >> "' >> ~/.bashrc
echo -e "\nexport HISTTIMEFORMAT" >> ~/.bashrc
echo -e "\nalias ll='ls -al'" >> ~/.bashrc
echo -e "\nalias cp='cp -i'" >> ~/.bashrc
echo -e "\nalias mv='mv -i'" >> ~/.bashrc
echo -e "\nalias df='df -h'" >> ~/.bashrc
echo -e "\nalias free='free -m'" >> ~/.bashrc
echo -e "\nalias d='docker'" >>  ~/.bashrc
echo -e "\nalias dc='docker-compose'" >>   ~/.bashrc

hostnamectl set-hostname [호스트네임]

'AWS' 카테고리의 다른 글

ecs container access log > cloudwatch  (0) 2023.06.30
Docker 설치 스크립트  (0) 2023.06.02
ecs 생성 로그 logrotate.conf  (0) 2023.06.02
ECS+ECR+Jenkins+Github  (0) 2023.04.21
ECS+ECR 업데이트  (0) 2023.04.14