ssh 포트번호 변경

ubuntu 2020. 1. 3. 02:40

    1  sudo vi /etc/ssh/sshd_config
    2  service sshd restart
    3  sudo ufw allow 18182

 

user@ubuntu16:~$ cat /etc/ssh/sshd_config
# Package generated configuration file
# See the sshd_config(5) manpage for details

# What ports, IPs and protocols we listen for
Port 18182
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes

# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 1024

# Logging
SyslogFacility AUTH
LogLevel INFO

# Authentication:
LoginGraceTime 120
PermitRootLogin prohibit-password
StrictModes yes

RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys

# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes

# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no

# Change to no to disable tunnelled clear text passwords
#PasswordAuthentication yes

# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no

#MaxStartups 10:30:60
#Banner /etc/issue.net

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

Subsystem sftp /usr/lib/openssh/sftp-server

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes

 

 

'ubuntu' 카테고리의 다른 글

mysql 외부접속  (0) 2020.04.24
우분투 타임존 변경  (0) 2020.03.17
[Ubuntu 16.04] node.js 와 npm 설치  (0) 2019.11.27
우분투 16.04.06 init.d venv 만들기  (0) 2019.11.20
aws 아마존 시간존 변경  (0) 2019.10.04
Posted by wakira
,

homebrew nvm 설치

OS X 설정 2019. 12. 2. 23:05

  246  sudo chown -R $(whoami) /usr/local/share/man/man8
  247  chmod u+w /usr/local/share/man/man8
  248  brew install nvm
  249  nvm -v
  250  nvm -vmkdir ~/.nvm
  251  mkdir ~/.nvm
  252  vi ~/.zshrc
  257  nvm --version
  260  nvm ls-remote
  261  nvm install v12.13.0
  262  node -v
  264* node -v

'OS X 설정' 카테고리의 다른 글

Catalina 카타리나 usb 만들기  (0) 2020.08.09
Mojave 모하비 usb 만들기  (0) 2019.07.21
맥 ssh 입력주소 줄이기  (0) 2019.07.21
맥 초기 설치  (1) 2018.09.07
high Sierra 이미지 usb만들기  (0) 2018.01.25
Posted by wakira
,

우분투에서 Node.js 설치를 할 수 있는 방법은 여러가지 있습니다.

4.x 버전을 설치하려면 아래 1번 방법을 통해 손쉽게 설치할 수 있으며, 그 이상의 버전을 설치하기 위해선 2번 방법을 통해 설치할 수 있습니다. 또는 여러 버전의 Node.js를 설치 및 관리하기 위해 nvm을 이용하는 3번의 방법으로도 설치할 수 있습니다.
설치하려는 환경에 맞게 방법을 선택하여 설치하시기 바랍니다.

1. 우분투 저장소의 Distro-Stable 버전 설치

우분투 16.04의 패키지 저장소에 Node.js가 기본으로 들어가져 있습니다. 이 글을 쓰는 현 시점에 v4.2.6 버전이 저장소에 올려져있습니다.

apt 패키지 매니저를 통해 손쉽게 설치할 수 있습니다.

sudo apt-get update sudo apt-get install nodejs

추가로 npm을 설치하기 위해서는 다음과 같이 입력하면 됩니다.

sudo apt-get install npm

다른 패키지와의 충돌을 방지하기 위해, 우분투 저장소의 Node.js는 node 대신 nodejs 명령어를 사용합니다.

다음 명령어로 정상적으로 Node.js가 설치되었는 지 확인할 수 있습니다.

nodejs -v # v4.2.6

2. PPA를 이용한 최신버전 설치

Node.js 최신 버전을 설치하기 위해서는 NodeSource에서 운영되는 PPA (personal package archive)를 추가하여 설치할 수 있습니다. PPA를 이용하면 우분투 저장소에서 제공하는 4.x 버전(2017년 4월까지 지워하는 예전 LTS 버전)뿐만 아니라 6.x 버전(2018년 4월까지 지원하는 최신 LTS 버전)와 7.x 버전(현재 개발 버전)까지 선택하여 설치할 수 있습니다.

이 예제에서는 6.x 버전을 설치할 것 입니다. 다른 버전을 설치하기 위해선 아래 curl 명령어의 6.x 문자를 원하는 버전으로 수정하여 다운로드 받으시면 됩니다.

cd ~ curl -sL https://deb.nodesource.com/setup_6.x -o nodesource_setup.sh

sudo 권한으로 다음 명령어를 실행하면 PPA를 추가하고 업데이트까지 자동으로 실행됩니다. 이후 작업은 첫번째 Distro-Stable 버전 설치 방법과 동일합니다.

sudo bash nodesource_setup.sh sudo apt-get install nodejs

PPA를 통해 Node.js를 설치하면 nodejs 뿐만 아니라 npm까지 같이 설치되므로 따로 npm을 설치할 필요가 없습니다. 하지만 npm이 제대로 동작하기 위해선 build-essential 패키지를 설치해야 합니다.

sudo apt-get install build-essential

3. NVM을 이용한 설치

apt 패키지 매니저 대신, Node.js version manager nvm을 이용하여 설치할 수 도 있습니다.

nvm을 이용하면 Node.js의 여러 버전을 설치하고 쉽게 환경 관리를 할 수 있습니다.

우선 우분투 저장소에서 nvm 설치에 필요한 패키지들을 설치합니다.

sudo apt-get update sudo apt-get install build-essential libssl-dev

다음으로 nvm 설치 스크립트를 다운로드 후 실행시켜 줍니다.

curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh -o install_nvm.sh bash install_nvm.sh source ~/.profile

설치가 완료되면 home 디렉터리에 ~/.nvm 폴더가 생성됩니다.

설치 가능한 Node.js 버전 목록을 확인하기 위해서 다음과 같이 입력하면 됩니다.

nvm ls-remote# 결과 v5.8.0 v5.9.0 v5.9.1 v5.10.0 v5.10.1 v5.11.0 v6.0.0

원하는 버전을 선택한 후 다음과 같이 설치하면 됩니다.

nvm install 6.0.0

여러 버전의 Node.js를 설치했다면 다음과 같이 특정 버전으로 변경하여 사용할 수 있습니다.

nvm use 6.0.0

nvm을 이용하여 Node.js를 설치하면 1, 2번 방법과 달리 node 명령어를 사용해야 합니다.

node -v # v6.0.0

설치된 Node.js 버전 목록을 보려면 다음과 같이 입력하면 됩니다.

nvm ls

https://itstory.tk/entry/Ubuntu-1604-nodejs-와-npm-설치

 

[Ubuntu 16.04] node.js 와 npm 설치

우분투에서 Node.js 설치를 할 수 있는 방법은 여러가지 있습니다. 4.x 버전을 설치하려면 아래 1번 방법을 통해 손쉽게 설치할 수 있으며, 그 이상의 버전을 설치하기 위해선 2번 방법을 통해 설치할 수 있습니다..

itstory.tk

 

 

 

    9  sudo apt-get install -y build-essential libssl-dev
   10  curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh -o install_nvm.sh
   13  bash install_nvm.sh
   15  source ~/.profile
   18  nvm ls-remote
   19  nvm install 13.2.0
   20  nvm use 13.2.0
   21  nvm ls
   22  node -v
   23  java -version
   24  sudo apt install default-jre
   26  git clone https://github.com/processing/p5.js-website.git
   27  npm -version
   28  cd p5.js-website/

'ubuntu' 카테고리의 다른 글

우분투 타임존 변경  (0) 2020.03.17
ssh 포트번호 변경  (0) 2020.01.03
우분투 16.04.06 init.d venv 만들기  (0) 2019.11.20
aws 아마존 시간존 변경  (0) 2019.10.04
aws 첫 시작  (0) 2018.05.08
Posted by wakira
,