Skip to main content

LinuxサーバーでOpenSSH設定

ちょっとOSが古いが、OpenSSHの設定をすることになったので記載します。

○環境
CentOS 5.1


■事前準備
まずはサーバーにSSHでログインするためのユーザを設定しておく。
ここではlinuxというユーザを作成

1.ユーザの作成
useradd linux

2.パスワードの設定
passwd linux


■SSHの設定
今回はログイン認証でのSSH設定の説明をします。
(なぜならば鍵認証でつまづいたため。詳しくはこちら

1.OpenSSHサーバーのインストール
yum -y install openssh-server

2.OpenSSHの設定ファイル変更
vi /etc/ssh/sshd_config

--------------------------------------------------
#PermitRootLogin yes

PermitRootLogin no

#PermitEmptyPasswords no

PermitEmptyPasswords no

#PasswordAuthentication yes

PasswordAuthentication yes
---------------------------------------------------

3.OpenSSHの再起動
/etc/rc.d/init.d/sshd restart


■PuTTYでSSH接続
1.PuTTYをダウンロード

2.PuTTYインストール後、サーバーに接続
以下を入力して、Openをクリック
Host Name:サーバーのIPアドレス

3.サーバーにログイン
事前準備で作成したユーザでログインする。


■WinSCPでファイルアップロード
1.WinSCPをダウンロード

2.WinSCPインストール後、セッションを作成
以下を入力して、ログインをクリック
転送プロトコル:SFTP
ホスト名:サーバーのIPアドレス
ポート番号:22(ここではそのままを使用)
ユーザー名:linux(事前準備で作成したユーザーのユーザー名)
パスワード:linuxpass(事前準備で作成したユーザーのパスワード)

3./home/linuxのフォルダならファイルのアップロードが可能
他のフォルダは権限がないためアップロードできない場合があります。


○参考サイト
http://www.k4.dion.ne.jp/~mms/unix/linux_com/useradd.html
http://kajuhome.com/openssh.shtml
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
http://winscp.net/eng/download.php

Comments

Popular posts from this blog

How to deploy your PHP and Java file in PHP/JavaBridge

Here I explain how to deploy your PHP and Java file in your PHP/JavaBridge folder. You may need basic knowledge of Linux command, PHP , Java , Tomcat . Please use the link below to go to further reading if necessary. I. How to install Java II. How to install Tomcat III. How to install PHP and CGI IV. How to deploy PHP/JavaBridge V. How to deploy your PHP and Java files V. Deploy your PHP and Java file In this chapter, I will not talk detail about how to create and run Java . If you are curious about how to create PHP that executes Java , check PHP/JavaBridge site. 1. Create Java Hello World 1.1. Open eclipse and create Java Project . 1.2. Create HelloWorld.java file under the project. import javax.swing.JOptionPane; public class HelloWorld {     public static final String JAVABRIDGE_PORT="8080";     static final php.java.bridge.JavaBridgeRunner runner = php.java.bridge.JavaBridgeRunner.getInstance(JAVABRIDGE_PORT);     public stat...

How to install PHP/JavaBridge on Mac 

Looking for how to execute Java from PHP or vice versa? By using PHP/JavaBridge , it is possible! Here I write the instraction of how to set up PHP/JavaBridge on your Mac . You may need basic knowledge of Linux command, PHP , Java , Tomcat . Please read following links. I. How to install Java II. How to install Tomcat III. How to install PHP and CGI IV. How to deploy PHP/JavaBridge V. How to deploy your PHP and Java files If you have any suggestion and question, especially technically and grammatically, please feel free to leave your comment. Thank you for your visit😊

How to install Java on your Mac 

Here I explain about how to install Java on your . You may need basic knowledge of Linux command, PHP , Java , Tomcat . Please use the link below to go to further reading if necessary. I. How to install Java II. How to install Tomcat III. How to install PHP and CGI IV. How to deploy PHP/JavaBridge V. How to deploy your PHP and Java files I. How to install Java 1. Download JDK Install most up-to-date JDK from Oracle site . Click downloaded dmg file and follow the guidance. Please follow the step explain this site if you have problem following the instruction. 2. Set up JAVA_HOME 2.1. Open Terminal and enter the following command. vim ~/.bash_profile 2.2. Enter  i  to change to insert mode. 2.3. Add JAVA_HOME as follow. export JAVA_HOME=/Library/Java/JavaVirtualMachines/{your JDK folder}/Contents/Home 2.4. Press esc button and enter  :wq  to save and quit the .bash_profile . 2.5. Enter the command below to update bash source .bash_p...