su - 명령어 사용제한에 따른 문제 입니다.

kimyh의 이미지

어제 비슷한 내용의 질문을 올렸는데 제가 설명이 부족했는지 하루가 지나도 답변이 없군요.
날밤새며 고생하고 있으니 도와 주시면 감사하겠습니다.

리눅스 레드햇9를 설치하고 보안을 위해 sshd에 특정아이디만 su명령어를 사용하게 할려고 아래와 같이
설정을 하였습니다.

먼저 일반계정 abcd를 생성하였습니다.
다음에는 /bin 디렉토리에 있는 sudo를 rm -rf /bin/sudo 명령으로 삭제하고
chmod 4750 /bin/su 로 퍼미션을 바꾸어주고
vi /etc/group 하여 wheel:x:10:root,abcd 로 하여 wheel 그룹에 추가하고
chown root:wheel /bin/su 소유그룹을 root에서 wheel로 바꾸고

vi /etc/pam.d/su 해서
auth sufficient /lib/security/pam_rootok.so
auth required /lib/security/pam_wheel.so use_uid

라인을 추가 해 주었습니다.

물론 sshd에서 다른아이디로 접속하면 아래와같이
[xxxx@aaaa xxxx]$ su -
-bash: /bin/su: 허가 거부됨
[xxxx@aaaa xxxx]$

로 나오고

abcd로 접속하면 su 명령어가 거부 되지는 않는데 아래와 같이 root비번이 먹혀 들어가지를 안는군요.
[abcd@aaaa abcd]$ su -
Password:
su: incorrect password
[abcd@aaaa abcd]$

혹시root비번을 잘못입력 했나 싶어 여러차례 해봐도 마찬가지 입니다.
도대체 뭐가 잘못된건지 아시는분 도움 주시면 감사 하겠습니다.

M.W.Park의 이미지

/etc/sudoers 설정만으로는 안되는 일인가요?

-----
오늘 나의 취미는 끝없는, 끝없는 인내다. 1973 法頂

-----
오늘 의 취미는 끝없는, 끝없는 인내다. 1973 法頂

김정균의 이미지

redhat 9 을 설치하셨다는 것에서 위의 작업들이 무용지물입니다. 굳이 su 를 하지 않아도 root 를 획득할 수 있는 구멍이 너무 많습니다. 왠만하면 life time 이 살아있는 배포본을 선택하시기 바랍니다.

제 경험에 의하면 퍼미션까지 바꿔가면서 보안을 강화해야할 일은 별로 없었던 것 같습니다. 오히려 보안 버그가 있는 패키지들을 빨리빨리 catch 해서 픽스하는 것이 더 확실한 방법입니다.

그리고, su 명령은 pam_wheel.so 를 등록하면 알아서 pam 이 일반 유저의 su 접근을 막아 줍니다. 굳이 퍼미션을 4750으로 해야 할 필요가 없을 것 같은데요.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.