posted by 빠담아빠다 2017. 6. 14. 10:28

linux chaell 환경에서 명령 프롬프트에 현재 위치(pwd) 표시하기

기존
[root@cae001 ~]$
[root@cae001 ~/tmp]$
[root@cae001 scripts]$

1. 홈폴더내의 환경 파일 오픈
vi .cshrc

2. 내용입력
set prompt="['/use/bin/whoami'@'/bin/hostname' :'pwd']$ "
alias cd 'cd \!*; set prompt="['/use/bin/whoami'@'/bin/hostname' :'pwd']$ "'

폰에서 입력이니

작은따옴표밖에 안되지만
명령어는 shift+~ 로 처리 바람

'OS > Linux' 카테고리의 다른 글

[Linux] CFX5solve rsh 관련 이슈  (0) 2016.03.10
[Linux] ssh인증 오류  (0) 2016.03.10
[Linux] ashrock network 드라이버 설치 관련. e1000e-3.2.4.2  (0) 2016.03.10
[Linux] pssh script  (0) 2016.03.10
[YUM] yum repository Local 참조  (0) 2016.03.10
posted by 빠담아빠다 2016. 3. 10. 16:32

cfx5solve 실행시 

다음의 오류메시지 출력 

+--------------------------------------------------------------------+ 

| An error has occurred in cfx5solve:  | 

| Remote connection to myserver01 exited with return code 1. It 

| gave the following output: 

| remuser too long 

| Check that you have typed the hostname correctly, that you have an | 

| account "changyoung.choi" on the specified host with permission to | 

| rsh from this host, and that (particularly for Windows hosts) it | 

| is running an rsh daemon. You can use the following command to | 

| check the connection to a UNIX machine: | 

| | 

| rsh myserver01 uname | 

| | 

| or the following command if it is a Windows machine: | 

| | 

| rsh myserver01 cmd /c echo working | 

+--------------------------------------------------------------------+


remuser too long 혹은 localuser too long 메시지는 

그러니까. rsh 로 접근이 가능하여도

rsh myserver01 ls

혹은 rsh myserver01 df 등의 커맨드를 날릴 경우 remuser too long 이라는 메시지가 출력되는데

userid가 14char가 넘는 유저가 rsh명령어를 날리고 받을때 나타나는 메시지 입니다.


예) changyoung.choi <- 기 

rsh ins1 -> 접속 가능 

rhs ins1 ls -> ls 명령 실행 불가


cfx 실행 이전에 

export CFX5RSH=ssh


환경 적용후 실행.


remote shell (rsh -> ssh)변경이 됨.



'OS > Linux' 카테고리의 다른 글

[linux] cshell prompt에 현재위치 표기  (0) 2017.06.14
[Linux] ssh인증 오류  (0) 2016.03.10
[Linux] ashrock network 드라이버 설치 관련. e1000e-3.2.4.2  (0) 2016.03.10
[Linux] pssh script  (0) 2016.03.10
[YUM] yum repository Local 참조  (0) 2016.03.10
posted by 빠담아빠다 2016. 3. 10. 16:31

나는 ssh인증을 했는데

자꾸자꾸 비밀번호를 물어본다.

authorized_keys도 했는데 자꾸자꾸 비밀번호를 물어본다.

원래 ssh로 다른서버 넘어가면 암호를 안물어봤는데 갑자기 자꾸자구 암호를 물어본다.



1. 요청오류내용 

(gnome-ssh-askpass:53991): Gtk-WARNING **: cannot open display: dhhpcmgr2:0.0


2. 현상확인 

해당유저 및 일부 유저 로그인 후 ssh로 다른서버 접속시 암호 묻는 현상. (인증이 정상적으로 이루어지지 않고있다)


3. ssh 인증 오류 확인 내용 

1) $HOME 권한 확인 

2) $HOME/.ssh 권한 확인 

3) $HOME/.ssh/authorized_keys 권한 확인


1) $HOME 권한 : 기본 700 

admin이 770 혹은 777로 변경한 경우(group/others 권한에 write권한이 있을경우) 오류가 발생함. 

700,710,740,750 <- 적용시 사용가능


2) $HOME/.ssh 권한 700 확인 

아닐경우 chmod 700 $HOME/.ssh


3) $HOME/.ssh/authorized_keys 권한 600 확인 

아닐경우 : chmod 600 $HOME/.ssh/*


4. 원인 

그룹별 사용자의 home directory 공유를 위해 $HOME의 권한을 770으로 적용한 것

posted by 빠담아빠다 2016. 3. 10. 16:31

ashrock network 드라이버 설치 관련.

파일 및 버전 : e1000e-3.2.4.2.tar

 

1. 압축해제

tar -xvf e1000e-3.2.4.2.tar

 

2. 컴파일

cd e100e-3.2.4.2/src

make install

modprobe e100e

 

3. network 파일 수정

cat /etc/sysconfig/network

NETWORKING=yes

HOSTNAME=hadoop03

 

4. ifcfg-eth0파일 생성 및 내용수정 (IPADDR/NETMASK/GATEWAY/HWADDR/ONBOOT)

DEVICE=eth0

TYPE=Ethernet

IPADDR=192.168.222.132

NETMASK=255.255.255.0

GATEWAY=192.168.222.1

ONBOOT=yes

USERCTL=no

BOOTPROTO=none

NM_CONTROLLED=yes

PREFIX=24

DEFROUTE=yes

IPV4_FAILURE_FATAL=yes

IPV6INIT=no

NAME=eth0

HWADDR=D0:50:99:77:18:02



'OS > Linux' 카테고리의 다른 글

[Linux] CFX5solve rsh 관련 이슈  (0) 2016.03.10
[Linux] ssh인증 오류  (0) 2016.03.10
[Linux] pssh script  (0) 2016.03.10
[YUM] yum repository Local 참조  (0) 2016.03.10
[Redmine] Redmine Service File , linux service 등록  (0) 2016.03.10
posted by 빠담아빠다 2016. 3. 10. 16:31

#!/bin/sh

file=$1

cmd=$2


#cat $file | while read line; do

for line in $(cat $file);do

  echo "### ssh $line $cmd ###"

  ssh $line $cmd

done



posted by 빠담아빠다 2016. 3. 10. 16:30

yum repository Local 참조.


iso 이미지 마운트 참조.
순서.
1. 이미지를 마운트.
2. /etc/yum.repos.d/rhel-source.repo 파일을 수정.
3. yum list로 확인한다.

1. 마운트 
[root@node01 shared]# mount -o loop rhel-server-6.4-x86_64-dvd.iso /shared/isomount/


2. rhel-source.repo 파일 수정
iso 이미지 파일을 마운트 위치 등록. (하단에 추가)
[root@node01 shared]# cat /etc/yum.repos.d/rhel-source.repo
[Local-Package]
name=Local Redhat Linux
baseurl=file:///shared/isomount
enabled=1
gpgcheck=0 


3. 확인
[root@node01 shared]# yum list
wireshark.i686 1.2.15-2.el6_2.1 Local-Package 
x86info.x86_64 1:1.25-1.32.el6 Local-Package 
xcb-util.i686 0.3.6-1.el6 Local-Package 
xdelta.i686 1.1.4-8.el6 Local-Package 
xfig-plain.x86_64 3.2.5-23.a.el6 Local-Package 
xmlrpc-c.i686 1.16.24-1209.1840.el6 Local-Package 
xmlrpc-c-client.i686 1.16.24-1209.1840.el6 Local-Package 
xorg-x11-drv-intel.i686 2.20.2-2.el6 Local-Package 
xorg-x11-drv-openchrome.i686 0.3.0-3.20120806git.el6 Local-Package 
xulrunner.i686 10.0.12-1.el6_3 Local-Package 
xz-devel.i686 4.999.9-0.3.beta.20091007git.el6 Local-Package 
xz-libs.i686 4.999.9-0.3.beta.20091007git.el6 Local-Package 
yajl.i686 1.0.7-3.el6 Local-Package 
yum-plugin-aliases.noarch 1.1.30-14.el6 Local-Package 
yum-plugin-changelog.noarch 1.1.30-14.el6 Local-Package 
yum-plugin-downloadonly.noarch 1.1.30-14.el6 Local-Package 
yum-plugin-tmprepo.noarch 1.1.30-14.el6 Local-Package 
yum-plugin-verify.noarch 1.1.30-14.el6 Local-Package 
yum-plugin-versionlock.noarch 1.1.30-14.el6 Local-Package 
yum-presto.noarch 0.6.2-1.el6 Local-Package 
zlib-devel.i686 1.2.3-29.el6 Local-Package 
zsh.x86_64 4.3.10-5.el6 Local-Package


Local-Package 적용 확인.



이후에 설치중 패키지가 없을때 Local-Package쪽에서 설정한다.

posted by 빠담아빠다 2016. 3. 10. 16:30

주의!! <- 퍼렁색은 실제 디랙토리 위치에 지정


service redmine start

service redmine stop

service redmine status

service redmine restart


보라색배경은 꼭 있어야 된다고 한다.


Linux Service 등록 


1). 아래의 소스를 /etc/init.d/ 아래에 redmine으로 저장한 뒤

2). chkconfig --add redmine

3). chkconfig --list redmine으로 on/off 상태 확인하고.

 ex)[root@redmine2 init.d]# chkconfig --list redmine

      redmine         0:off 1:off 2:off 3:off 4:off 5:off 6:off


4). 위와같이 off 상태이면  chkconfig redmine on 

5). 한번더 확인

  ex) [root@redmine2 init.d]# chkconfig --list redmine

        redmine         0:off 1:off 2:on 3:on 4:on 5:on 6:off


#!/bin/sh

# chkconfig: 2345 95 20

# description: Some description

# What your script does (not sure if this is necessary though)

# processname: myscript


status=`ps -ef |grep ruby|grep redmine | awk '{print $2}'`


if [ "$1" == "start" ];then


  if [ "$status" != "" ];then


    echo "redmine (pid  $status) is running..."


  else


    echo "Starting redmine"

    /usr/local/bin/ruby /redmine/redmine-2.4.2/script/rails server webrick -e production -d


  fi


elif [ "$1" == "stop" ]; then


  echo "Stopping redmine"

  kill -9 $status

 

elif [ "$1" == "status" ];then


  if [ "$status" != "" ];then


    echo "redmine (pid  $status) is running..."


  else


    echo "redmine is stopped"


  fi


elif [ "$1" == "restart" ];then


  echo "Stopping redmine"

  kill -9 $status

  echo "Starting redmine"

  /usr/local/bin/ruby /redmine/redmine-2.4.2/script/rails server webrick -e production -d


else


 echo "redmine {start|stop|restart|status}"


fi 


'OS > Linux' 카테고리의 다른 글

[Linux] pssh script  (0) 2016.03.10
[YUM] yum repository Local 참조  (0) 2016.03.10
[Linux] bash shell shock  (0) 2016.03.10
[Linux] ibus-daemon start on boot (시작프로그램 등록)  (0) 2016.03.10
[Linux] 영어설치 -> 한글설치  (0) 2016.03.10
posted by 빠담아빠다 2016. 3. 10. 16:29

들어가며.

linux/unix환경에서 발견된 배시셸 버그

공백 뒤의 커맨드가 적용이 된다는 문제?


1. 체크

env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
vulnerable
this is a test


이렇게 나오면 버그가 있는 환경.

vulnerable가 출력되면 안됨, 악용요지 있음.


2.패치된 파일.

 bash-4.1.2-15.el6_5.1.x86_64.rpm

3. 다운로드 후 

 rpm -Uvh bash-4.1.2-15.el6_5.1.x86_64.rpm


4.적용후

env x='() { :;}; echo vulnerable' bash -c "echo this is a test"

bash: warning: x: ignoring function definition attempt

bash: error importing function definition for `x'

this is a test


* 적용 OS RHEL 6.3

* 임시로? 나온 패치 버전? 인지 확인 안됨. 



posted by 빠담아빠다 2016. 3. 10. 16:28


1. 시스템 > 시작프로그램 

 

 

'OS > Linux' 카테고리의 다른 글

[Redmine] Redmine Service File , linux service 등록  (0) 2016.03.10
[Linux] bash shell shock  (0) 2016.03.10
[Linux] 영어설치 -> 한글설치  (0) 2016.03.10
[Flexlm] Flexlm error code  (0) 2016.03.10
[Linux] Linux certmonger hangs on boot [임시]  (0) 2016.03.10
posted by 빠담아빠다 2016. 3. 10. 16:28

/etc/sysconfig/i18n 를 수정해야 함.


1.linux 버전

[root@server01 ~]# cat /etc/redhat-release 

Red Hat Enterprise Linux Server release 6.3 (Santiago)



현재 영어로 되어있는 내 i18n 파일 내용


[root@server01 sysconfig]# cat i18n

LANG="en_US.UTF-8"

SYSFONT="latarcyrheb-sun16"




-> 변경

[root@lsfse002 sysconfig]# cat i18n

LANG="ko_KR.UTF-8"

SUPPPORTED="ko_KR.UTF-8:ko_KR.eucKR:ko_KR:ko"

SYSFONT="lat0-sun16"

SYSFONTACM="8859-15"


=====================참고==============================

CentOS 한글 설정 및 X Window설치

CentOS(Redhat) 2014/01/13 12:15

X Windows System, Gnome Desktop 환경설치
yum groupinstall "x window system" "gnome desktop environment"

 

한글폰트 설치
yum install fonts-korean

 

X Window 실행
startx

 

한글깨짐 현상 수정
vagrant를 이용하여 centos를 설치한 후 ssh로 연결하면 한글이 깨짐



- ibus 한글 설치

 

yum install kde-i18n-Korean <- 여기서 "K"는 한글

yum install fonts-korean

yum install ibus-hangul

 

/etc/sysconfig/i18n의 설정을 바꿔야함.

 

(1) UTF-8 모드로 운영할때 [이것을 적용]
LANG="ko_KR.UTF-8"
SUPPPORTED="ko_KR.UTF-8:ko_KR.eucKR:ko_KR:ko"
SYSFONT="lat0-sun16" <---여기서 lat0 의 0은 숫자0
SYSFONTACM="8859-15" <- 이것을 추가 하지 않음

(2) euc_KR 모드로 사용할때
LANG="ko_KR.eucKR"
SUPPORTED="ko_KR.eucKR:ko_KR:ko"
SYSFONT="lat0-sun16"
SYSFONTACM="8859-15" <- 이것을 추가 하지 않음


출처 : http://freesp.tistory.com/trackback/47

http://freesp.tistory.com/entry/CentOS-한글-설정-및-X-Window설치