Académique Documents
Professionnel Documents
Culture Documents
Objective: The Objective of this document is to login successfully to the Linux Machine (Centos 5) using
SSH and Transfer files securely via SFTP.
Information:
Linux Server IP: 192.168.248.67
Linux Server Hostname: MNLCTO01
2. Open the Putty.exe software, then the program will appear and you will this:
3. Under the Category "Session" type in the IP address or Hostname of the Linux Server example "192.168.248.67" or
"MNLCTO01"
.
The protocol should be "22" by default (don't change this). Press "Enter" to continue.
4. Login using the username given to you. Hit "Enter" to proceed.
8. Hit "Enter" to continue. By default, the keys will be saved at the location /home/username/.ssh the “id_rsa” is the
actual keyfile.
9. Now, the directory has been created. You have to enter the passphrase, if you don't want a passphrase leave it
blank. To proceed hit "Enter".
10. The keys have been generated. To verify you can go to the directory /home/testuser1/.ssh.
Type in: #cd /home/testuser1/.ssh if you username is Michael type in: #cd /home/michael/.ssh
11. To verify the files inside the directory. Type in: #ls –la
12. Copy the id_rsa.pub to authorized_keys. Type in the following: # cp id_rsa.pub authorized_keys. To verify, again
type in: #ls -la you will see that it has been added into the directory.
13. Now, we have to SSH to the server to established ourself and be added into the known_host.
Type in the following: # ssh testuser1@MNLCTO01 or ssh testuser1@localhost
If your username is raul, the command should be: # ssh raul@localhost or # ssh raul@ MNLCTO01
14. Enter the passphrase you enter when creating the keys. If none leave it blank then Hit "Enter".
15. Now, you have already been added to the Known_hosts file. To verify make sure you are in the directory
/home/testuser1/.ssh if not, type in: #cd /home/testuser1/.ssh then, type in: #ls –la
Using WinSCP
1. Run winscp405. Enter the IP Address/hostname of the server (192.168.248.67 or MNLCTO01). Also, enter your
username and password. Once you are ready Hit "Login"
3. Now you have already connected to the Linux server (as you can see below.). Go to the .ssh folder
4. Copy the following files in the .ssh folder to your local Windows workstation. Copy id_rsa id_rsa.pub and
known_hosts to your local workstation ex. C:\My Documents
To select the files click on the files while pressing the “CTRL” button, the drag it to the left then click “Copy” or Hit
“F5”
4. Save it to any location on your local machine. After you have save it we will try to test it using PuTTY to login.
3. Once the private key is attached make sure you have entered the IP address/Hostname in the Category "Sessions".
When you are ready click "Open" to connect to the Linux server.
4. Login using your username.
You were now able to connect to the Linux Server using just your username!
Testing SFTP connection
To connect via SFTP to the Linux server type in:
# sftp localhost or # sftp 192.168.248.67 or # sftp MNLCTO01
Then enter the passphrase of the key.