"EOS /mnt/flash를 홈 폴더로 사용하는 계정 생성"의 두 판 사이의 차이

27번째 줄: 27번째 줄:
==실행 예시==
==실행 예시==
<source lang='dos'>
<source lang='dos'>
[admin@localhost ~]$ mkdir /mnt/flash/home
[admin@localhost ~]$ cat>/mnt/flash/init_testuser.sh<<EOF
[admin@localhost ~]$ sudo useradd testuser -d /mnt/flash/home/testuser
> mkdir /mnt/flash/home
[admin@localhost ~]$ echo "P@ssword" | sudo passwd testuser --stdin
> sudo useradd testuser -d /mnt/flash/home/testuser
> echo "P@ssword" | sudo passwd testuser --stdin
> sudo gpasswd -a testuser eosadmin
> cp /home/admin/.bashrc /mnt/flash/home/testuser
> EOF
</source>
<source lang='dos'>
[admin@localhost ~]$ cat /mnt/flash/init_testuser.sh
mkdir /mnt/flash/home
sudo useradd testuser -d /mnt/flash/home/testuser
echo "P@ssword" | sudo passwd testuser --stdin
sudo gpasswd -a testuser eosadmin
cp /home/admin/.bashrc /mnt/flash/home/testuser
</source>
<source lang='dos'>
[admin@localhost ~]$ sh /mnt/flash/init_testuser.sh
Changing password for user testuser.
Changing password for user testuser.
[admin@localhost ~]$ sudo gpasswd -a testuser eosadmin
passwd: all authentication tokens updated successfully.
Adding user testuser to group eosadmin
Adding user testuser to group eosadmin
[admin@localhost ~]$ cp /home/admin/.bashrc /mnt/flash/home/testuser
</source>
</source>



2014년 7월 24일 (목) 11:14 판

1 개요

/mnt/flash를 홈 폴더로 사용하는 계정 생성
  • EOS 장비는 재부팅시 /mnt/flash 폴더를 제외하고 모두 초기화된다.
  • /mnt/flash 이하에 홈 폴더를 지정해주면 파일이 보존되므로 편리하다.
  • /mnt/flash에 접근하려면 eosadmin 그룹 권한이 추가되어야 한다.

2 명령어

기본 명령어
mkdir /mnt/flash/home
sudo useradd testuser -d /mnt/flash/home/testuser
echo "P@ssword" | sudo passwd testuser --stdin
sudo gpasswd -a testuser eosadmin
cp /home/admin/.bashrc /mnt/flash/home/testuser
스크립트로 저장
cat>/mnt/flash/init_testuser.sh<<EOF
mkdir /mnt/flash/home
sudo useradd testuser -d /mnt/flash/home/testuser
echo "P@ssword" | sudo passwd testuser --stdin
sudo gpasswd -a testuser eosadmin
cp /home/admin/.bashrc /mnt/flash/home/testuser
EOF

3 실행 예시

[admin@localhost ~]$ cat>/mnt/flash/init_testuser.sh<<EOF
> mkdir /mnt/flash/home
> sudo useradd testuser -d /mnt/flash/home/testuser
> echo "P@ssword" | sudo passwd testuser --stdin
> sudo gpasswd -a testuser eosadmin
> cp /home/admin/.bashrc /mnt/flash/home/testuser
> EOF
[admin@localhost ~]$ cat /mnt/flash/init_testuser.sh
mkdir /mnt/flash/home
sudo useradd testuser -d /mnt/flash/home/testuser
echo "P@ssword" | sudo passwd testuser --stdin
sudo gpasswd -a testuser eosadmin
cp /home/admin/.bashrc /mnt/flash/home/testuser
[admin@localhost ~]$ sh /mnt/flash/init_testuser.sh
Changing password for user testuser.
passwd: all authentication tokens updated successfully.
Adding user testuser to group eosadmin

4 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}