<단순한 텍스트로 구성할 경우>

$> vi /etc/motd

 

<색상을 넣고 싶은 경우>

$> vi create_motd.sh

    #!/bin/bash

    #define the filename to use as output

    motd="./motd"

    # Collect useful information about your system

    # $USER is automatically defined

    HOSTNAME=`uname -n`

    KERNEL=`uname -r`

    CPU=`uname -p`

    ARCH=`uname -m`

     

    # The different colours as variables

    Black="\033[0;30m"

    Red="\033[0;31m"

    Green="\033[0;32m"

    Blue="\033[0;33m"

    Purple="\033[0;34m"

    Cyan="\033[0;35m"

    Silver="\033[0;36m"

    DarkGray="\033[1;30m"

    LightBlue="\033[1;34m"

    LightGreen="\033[1;32m"

    LightCyan="\033[1;36m"

    LightRed="\033[1;31m"

    Yellow="\033[1;33m"

    White="\033[1;37m"

    X="\033[0;0m"

     

    clear > $motd # to clear the screen when showing up

    echo -e "$Red#=============================================================================#" >> $motd

    echo -e "   $White Welcome $Blue $USER $White to $Blue $HOSTNAME                " >> $motd

    echo -e "   $Red ARCH   $White= $ARCH                                   " >> $motd

    echo -e "   $Red KERNEL $White= $KERNEL                                 " >> $motd

    echo -e "   $Red CPU    $White= $CPU                                    " >> $motd

    echo -e "$Red#=============================================================================#" >> $motd

    echo -e "$Yellow

    This is a server to treat the personal information.

    If you have access to this server with unjustified way, you can receive legal penalty.

    Only your activities are allowed within the authority granted to you, and you can receive legal penalty for breaching it.

    You here all the activities are being recorded.

    In case of any problems, please feel free to contact abc@abc.com.

    (Tel. 010-0000-0000)" >> $motd

    echo -e "$X" >> $motd

$> chmod +x ./create_motd.sh

$> ./create_motd.sh

$> cp ./motd /etc/motd

 

'TA > Common' 카테고리의 다른 글

umount: device is busy  (0) 2013.02.04
glusterfs 3.3 설치 및 구성  (0) 2013.02.04
설치된 OS 버전 확인  (0) 2013.02.04
disk 추가 후, partition, format  (0) 2013.02.04
yum  (0) 2013.02.04
Posted by 옥탑방람보
,

WARNING! The remote SSH server rejected X11 forwarding request.

 

SSH 접속시 위와 같은 경고 메시지가 발생되고 x11 이 실행되지 않을 때,

 

$> yum install xauth

'TA > Common' 카테고리의 다른 글

disk 추가 후, partition, format  (0) 2013.02.04
yum  (0) 2013.02.04
VirtualBox 4.2.6 on Fedora 18/17, CentOS/Red Hat (RHEL) 6.3/5.8  (0) 2013.01.14
서브넷마스크 (subnet mask)  (0) 2012.12.28
IP 주소  (0) 2012.12.28
Posted by 옥탑방람보
,
sudo apt-get install ssh
sudo apt-get install openssh-server
sudo update-rc ssh defaults

 

'TA > Common' 카테고리의 다른 글

[linux] working multiple files on vi editor  (0) 2012.12.24
[linux] vi regular expression  (0) 2012.12.24
[ssh] Keeping SSH session from Firewall  (0) 2012.12.24
[linux] Adding a samba user on Ubuntu  (0) 2012.12.24
[linux] umout: device is busy  (0) 2012.12.24
Posted by 옥탑방람보
,
> vi /etc/ssh/ssh_config    (or  ~/.ssh/config)

Host *
    ServerAliveInterval 60

On Client machine,
The 'ServerAliveInterval 60' indicates that it should send a little bit of data over the connection every 60 seconds. You can avoid disconnection by many firewalls. Available on SSH protocol 2 version only.



Possible on server machine as an another solution,

> vi /etc/ssh/ssh_config

ClientAliveInterval 600
ClientAliveCountMax 3

 

'TA > Common' 카테고리의 다른 글

[linux] vi regular expression  (0) 2012.12.24
[ssh] start SSH server on Ubuntu  (0) 2012.12.24
[linux] Adding a samba user on Ubuntu  (0) 2012.12.24
[linux] umout: device is busy  (0) 2012.12.24
[ssh] Very slow login of SSH on Ubuntu  (0) 2012.12.24
Posted by 옥탑방람보
,
> vi /etc/nsswith.conf
hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4 
==>
hosts:          files mdns4_minimal [NOTFOUND=return] dns #mdns4 

 

Posted by 옥탑방람보
,

SRC-POINT -> DEST-POINT

1.
Setting up SSH key authentication (mostly skip this step)
First, you need to make sure the DEST-POINT has the ability to user key autherntication enabled.

> vi /etc/ssh/sshd_config
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
> /etc/init.d/sshd restart
 
2. Generation SSH public key in SRC-POINT
> ssh-keygen -t rsa
(*note: do not enter any passphrases on this, just hit enter when prompted)
 
3. Planting the public key to DEST-POINT
> vi ~/.ssh/authorized_keys
Add the public key of SRC-POINT
(*note:  user1> cat ~/.ssh/id_rsa.pub | ssh user1@DEST-POINT 'cat >> ~/.ssh/authorized_keys')
> chmod 755 ~/.ssh  (DEST-POINT)
> chmod 644 ~/.ssh/authorized_keys  (DEST-POINT)
(*note: check permissions all above directories of the "~/.ssh". If Group or Other permissions in them have "Write", sync between the two points are broken.)
 
 
* in Cluster (rocks)
In the default Rocks cluster configuration, /home is an automount directory. All nodes in the cluster system can mount the Home directory when an user accesses to each node.
Therefore, in cluster system, directories generated public key of SRC-POINT and DEST-POINT are same. "id_rsa.rsa" and "authorized_keys" files are located in same directory of an user home.
> ssh-keygen -t rsa
> cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

'TA > Common' 카테고리의 다른 글

[linux] How do I install yum-downloadonly plugin?  (0) 2012.12.24
[linux] write error in swap file  (0) 2012.12.24
[ssh] slow SSH login  (0) 2012.12.24
[linux] my bashrc  (0) 2012.12.24
[linux] 리눅스에서 열린 포트 확인하는 방법  (0) 2012.12.24
Posted by 옥탑방람보
,

[ssh] slow SSH login

TA/Common 2012. 12. 24. 17:11

1. Make sure DNS is properly configured on your system. Slow SSH logins are often caused by a name resolution timeout. Does your primary name server have entries for the systems from which you are connecting? Are the reverse lookup entries in place?  (from rocks-discuss)

2. If the server can not use DNS, enroll your local IP into /etc/hosts.
> vi /etc/hosts
IP_ADRESS   YOURHOSTNAME

 

Posted by 옥탑방람보
,

윈도우PC 에서 리눅스 서버으로 SSH 접속 시 X11 활성화 방법

 

1.     SSH X11 Forwarding Enable

A.     $> vi /etc/ssh/sshd_config

X11Forwarding yes

B.      $> /etc/init.d/sshd reload

2.     Xming 설치 및 실행

A.     다운로드: http://sourceforge.net/projects/xming/

B.      설치

C.      실행 실행여부확인은 트레이아이콘 생성이 되어 있으면 완료

3.     Xshell 로 접속시 (Xming 실행 후)

A.     다운로드: http://www.netsarang.co.kr/download/main.html

B.      설치

C.      파일 열기 열고자 하는 항목에서 우측클릭 등록정보 터널링 – “X11 연결을 다음으로 포워드합니다.” 체크 – X DISPLAY 선택 – localhost:0

D.     해당항목 접속

4.     Putty 로 접속시 (Xming 실행 후)

A.     다운로드: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

B.      설치

C.      실행 – Category 에서 SSH 밑에 X11 선택 – “Enable X11 forwarding” 체크 – X display location 항목에 localhost:0 입력

D.     해당항목 접속

 

Posted by 옥탑방람보
,