[질문] 계정으로 로그인 할 때

zaru의 이미지

Quote:
/bin/egrep: /bin/egrep: Permission denied

자꾸만 위와 같은 메시지가 보이네요.. 신경쓰입니다. mod는 700입니다.

codebank의 이미지

자동 스크립트에서 egrep을 사용하는 부분이 있는것 같네요.
mod가 700이란 소리는 /bin/grep의 mode를 이야기하는것이겠죠?
# ls -l /bin/egrep
해보시면 소유자나 그룹이 root로 되어있을거니다.
그런데 700으로 되어있다면 root이외의 다른 사람은 당연히 사용하지 못하겠죠.
문제해결을 위해서는 사용하는 shell의 rc파일(bash사용자라면 .bashrc)에서
egrep을 사용하는 부분을 찾아서 그것이 환경설정에 반드시 필요한 부분이 아니라면
'#'으로 막아주거나 지워버리면 됩니다.

------------------------------
좋은 하루 되세요.

zaru의 이미지

codebank wrote:
자동 스크립트에서 egrep을 사용하는 부분이 있는것 같네요.
mod가 700이란 소리는 /bin/grep의 mode를 이야기하는것이겠죠?
# ls -l /bin/egrep
해보시면 소유자나 그룹이 root로 되어있을거니다.
그런데 700으로 되어있다면 root이외의 다른 사람은 당연히 사용하지 못하겠죠.
문제해결을 위해서는 사용하는 shell의 rc파일(bash사용자라면 .bashrc)에서
egrep을 사용하는 부분을 찾아서 그것이 환경설정에 반드시 필요한 부분이 아니라면
'#'으로 막아주거나 지워버리면 됩니다.

제가 사용하는 .bashrc는 다음과 같습니다.

Quote:

# .bashrc

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

alias dir='ls -laF --color=auto'
alias ll='ls -laF --color=auto'
alias la='ls -aF --color=auto'
alias lh='ls -lh --color=auto'
alias l='ls -lF --color=auto'
alias ls='ls -F --color=auto'

alias h='history'
alias j='jobs -l'


어디가 egrep을 사용하는 부분인가요? mod를 711로 해도
Quote:
/bin/egrep: /bin/egrep: Permission denied

로 나옵니다. (mod를 711로 줘도 상관은 없나요?)

감사합니다.

===============================
힘써 면학하되 스스로 흥미를 느끼도록 하여야 하며 늘 익혀야 할 것이다

exsider의 이미지

Quote:
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

/etc/bashrc 파일이 있으면 그 파일 안의 내용을 보세요.
그리고 홈디렉토리에 .bash_profile 이 있으면 그것도 살펴보세요.

zaru의 이미지

exsider wrote:
Quote:
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

/etc/bashrc 파일이 있으면 그 파일 안의 내용을 보세요.
그리고 홈디렉토리에 .bash_profile 이 있으면 그것도 살펴보세요.

.bash_profile 파일은

Quote:
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin:/usr/local/mysql/bin

export PATH
unset USERNAME

/etc/bashrc 파일

Quote:
# /etc/bashrc

# System wide functions and aliases
# Environment stuff goes in /etc/profile

# by default, we want this to get set.
# Even for non-interactive, non-login shells.
if [ "`id -gn`" = "`id -un`" -a `id -u` -gt 99 ]; then
umask 002
else
umask 022
fi

# are we an interactive shell?
if [ "$PS1" ]; then
if [ -x /usr/bin/tput ]; then
if [ "x`tput kbs`" != "x" ]; then # We can't do this with "dumb" terminal
stty erase `tput kbs`
elif [ -x /usr/bin/wc ]; then
if [ "`tput kbs|wc -c `" -gt 0 ]; then # We can't do this with "dumb" terminal
stty erase `tput kbs`
fi
fi
fi
case $TERM in
xterm*)
if [ -e /etc/sysconfig/bash-prompt-xterm ]; then
PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm
else
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\007"'
fi
;;
screen)
if [ -e /etc/sysconfig/bash-prompt-screen ]; then
PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen
else
PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\033\\"'
fi
;;
*)
[ -e /etc/sysconfig/bash-prompt-default ] && PROMPT_COMMAND=/etc/sysconfig/bash-prompt-default
;;
esac
# Turn on checkwinsize
shopt -s checkwinsize
[ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "

if [ "x$SHLVL" != "x1" ]; then # We're not a login shell
for i in /etc/profile.d/*.sh; do
if [ -r "$i" ]; then
. $i
fi
done
fi
fi
# vim:ts=4:sw=4


이렇게 되어 있습니다. 로그인 시 환경설정 파일을 읽어 들일때 어느 부분이 /bin/egrep을 실행하는지요?

감사합니다.

===============================
힘써 면학하되 스스로 흥미를 느끼도록 하여야 하며 늘 익혀야 할 것이다

jedi의 이미지

저는 /etc/profile에 있습니다.

Quote:
$ grep egrep profile
if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then

권한을 바꾸시려면 755로 해주셔야 실행 권한도 주게 되고 에러가 없게 됩니다.

저 인용된 글속의 웃는 얼굴은 무엇을 말하는 것일까....흐흐흐..

+++ 여기부터는 서명입니다. +++
국가 기구의 존속을 위한 최소한의 세금만을 내고, 전체 인민들이 균등한 삶을
영위할 수 있는 착취가 없는 혁명의 그날은 언제나 올 것인가!
-- 조정래, <태백산맥> 중에서, 1986년

댓글 달기

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
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.