• Home
  • WordPress
  • web Hosting
  • linux
  • mysql
  • nginx
  • apache2
  • devops

Raju Ginni

wordpress tutorials seo hosting etc

You are here: Home / apache server tutorial (install,config, performance tuning, security, error handling) / connect to server by SSH client Putty SFTP client winscp LAMP, LEMP nginx apache etc linux

connect to server by SSH client Putty SFTP client winscp LAMP, LEMP nginx apache etc linux

 

 

 

Table of Contents

Toggle
    • #1 Download SSH client Putty & Putty gen
    • 1.2 Obtain IP Address  & root Password of the server
    • SSH connection through putty using root & password
  • Generating SSH keys & pairing between remote machine
    • #1. Generating SSH keys on remote server
    • #2 Connecting to Remote server & copying public key
    • Copying Public key to Authorized_keys .
  • How to use ssh-keygen to generate a new SSH key
    • Enable / disable root password login in SSH
  • Download winscp SFtp as for file Transfers
  • putty integration with winscp
  • Creating SSH Keys for non root users
  • Troubleshooting
  • VSFTPD FTP client installation

#1 Download SSH client Putty & Putty gen

puttygen optional to generate keys in local machine.

 

1.2 Obtain IP Address  & root Password of the server

if not, you can add ssh Key by their dashboard like google cloud, Digital ocean etc.

or you can directly login without any credentials from hosting provider dashboard with their building ssh client.

 

SSH connection through putty using root & password

 

enter your ip address and select port as 22, (21 for fTp).

Once its asks name enter root (any username if it is has root privileges)

then asks you enter the password.

once you login to

yournamme@machine# will appears

but you need to learn linux commands here

 

Generating SSH keys & pairing between remote machine

 

#1. Generating SSH keys on remote server

ssh-keygen -t rsa

or you can add encryption strength 1024, 2048, 4096 etc

ssh-keygen -t rsa -b 4096
root@instance-1:~# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:TooN6YdwYieraczFb+uL0wYxuEgcXsNPpuQK4OPxM9U root@instance-1
The key's randomart image is:
+---[RSA 2048]----+
|  .              |
|.. = o           |
|= * * .          |
|.O = + E         |
|= % O   S        |
|.= / = +         |
|o o X + .        |
| * ..*           |
|+  .=+o          |
+----[SHA256]-----+

 

private key location in /root/.ssh/id_rsa.
public key location  /root/.ssh/id_rsa.pub.
press enter thrice to create ssh keygen without password .
2.a   Login to other server and Copy the Pub key and pasteinto  destination linux machine
cat /root/.ssh/id_rsa.pub
login to 2nd computer
appned to authorized_keys
nano /.ssh/authorized_keys
or  ls
cd .ssh
and nano authorized_keys
Paste and save and exit.
root@instance-1:/# ls -a
. .cache boot etc lib lib64 lost+found mnt proc run srv tmp var
.. bin dev home lib32 libx32 media opt root sbin sys usr
root@instance-1:/# cd root
root@instance-1:~# ls -a
. .. .bashrc .profile .ssh
root@instance-1:~# cd .ssh
root@instance-1:~/.ssh# nano authorized_keys

#2 Connecting to Remote server & copying public key

Note: public key at Target machine (server)

Private key at source machine (local)

a. connection

ssh user@remoteip

ssh root@192.168.0.1

if ssh key it will ask you to yes or no

it asks root password , once you enter the root password.

it will allow to communicate.

 

after connection use SCP command

scp /var/www/bak.zip root@192.168.0.1: /var/www/

scp /var/www/html/srt.sql root@192.168.0.1:/var/www/html

Copying Public key to Authorized_keys .

we use cat command to append at end of the file or you can manually edit using nano.

 

cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

Beware: you must file path.

 

Then You may follow syncing & copying between 2 servers.

 

SSH Folder & keys file permission

File permissions should be

750 for folder &

640 for files.

 

How to use ssh-keygen to generate a new SSH key

 

  1. download puttygen
  2. click on generate keys
  3. just drag by mouse it will generate public & priate keys.

 

 

Copy the Prite keys to root/.ssh/authrized_keys

 

Manual through sftp client winscp

command line by nano command.

 

Restart SSHD if needed

sudo systemctl restart sshd.service

 

Enable / disable root password login in SSH

 

nano /etc/ssh/sshd_config

allow root password login = yes

comment or uncomment change no or year depending on your need.

its better to turn off root password to avoid attacks.

sudo service sshd reload

Download winscp SFtp as for file Transfers

 

we can do file transfer by SCP  & CP command . But the winscp gies a look of file manager just like cpanel.

  1. Download & install winscp.
  2. Open winscp and click add new site.
  3. Enter Ip address & Port
  4. Enter Username
  5. Password leave it blank if you already added Public key at server .
  6. click on Advanced and advanced>>SSH>> authenticate key browse for the private key and Save.
  7. or if you not yet added the public to the serer.
  8. by hosting provider dashboard ft gce,digital ocean etc
  9. login with root & password add key check connection then disable password
  10. Hosting provider default ssh client

Copy the Private key from server or generate private key pair form puttygen.

 

putty integration with winscp

 

download and install putty , then winscp automatically uses for command line interface.

winscp+putty (must).

other popular SFTP & FTP clients for windows

Filezilla etc

 

Creating SSH Keys for non root users

 

user able to login to /home/user/

after user login

generate key

the ssh directory basically already created in user directory.

.ssh

/home/user/.ssh/keys

root@instance-1:/home# cd ubuntu

root@instance-1:/home/ubuntu# ls -a
.  ..  .bash_logout  .bashrc  .profile  .ssh

root@instance-1:/home/ubuntu# cd .ssh
root@instance-1:/home/ubuntu/.ssh# ls -a
.  ..  authorized_keys
root@instance-1:/home/ubuntu/.ssh#

 

linux users & group management

 

 

////////////////////            ////

 

Troubleshooting

 

Incorrect public & private keys for User

 

Reasons: File Permissions  assign  directory & files  with Correct permissions.

Restrict usage to local computer
sudo nano /home/ssh-user/.ssh/authorized_keys
add this line very beginning of the file
from=”127.0.0.1″

VSFTPD FTP client installation

 

Install VSFTPD on the server

how to configure ftp server in linux centos
 
Step 1 Install VSFTD
sudo yum install vsftpd
or
Debian sudo apt-get install vsftpd
and then install ftp client
sudo apt-get install ftp
or
sudo yum install ftp
 
Step 2 configure vsftp
 
Open the config file 
 
sudo vi /etc/vsftpd/vsftpd.conf
 
Edit below lines
anonymous_enable=NO
 
 
local_enable=YES
 
and uncomment this line
 
chroot_local_user=YES
 (this command prevents users to access another directory)
 
Uncomment this 
chroot_list_file=/etc/vsftpd.chroot_list  
 
add fto username to get root privileges
 
 
Response: 500 OOPS: vsftpd: refusing to run with writable root inside chroot()
 
echo ‘allow_writeable_chroot=YES’ >> /etc/vsftpd/vsftpd.conf
 
systemctl restart vsftpd
 
how to check ssh version in linux
-A INPUT -m state –state NEW -m tcp -p tcp –dport 21 -j ACCEPT to iptbles
 
restart
 
systemctl restart vsftpd.service
systemctl enable vsftpd.service
sudo service vsftpd restart
 
 
 
ensure that vsftpd working 
 
chkconfig vsftpd on
 
 
Add FTP Port 21]
 
firewall-cmd –permanent –add-port=21/tcp
 
firewall-cmd –permanent –add-service=ftp
Restart firewall
firewall-cmd –reload
update boolean values for selinux
setsebool -P ftp_home_dir on  (if selinux)

apache server tutorial (install,config, performance tuning, security, error handling)

  • what is If-Modified-Since HTTP header how to add to Wordpress website
  • htaccess tutorial tips for wordpress #redirect #leverage browser cache #Gzip #KeepAlive
  • apache modules list (explained, enable disable)
  • connect to server by SSH client Putty SFTP client winscp LAMP, LEMP nginx apache etc linux
  • Lamp stack install on Ubuntu 20.4 LTS apache, mysql, php 7.4(Debian 9 & Ubuntu 18.04 lts)
  • apache performance tuning mpm-worker vs prefork vs event modules
  • enable caching in apache server (mod cache disk cache) vs fastcgi cache
  • how to enable KeepAlive connections in apache nginx wordpress
  • Cache control Header & expires headers How to set Properly
  • apache2 conf sample explained apache configuration file modules etc
  • restart apache in ubuntu (start | stop | reload | config test) centos debian mac linux windows 10 xampp
  • uninstall apache2 ubuntu in 3 steps Debian

hi i am raju ginni, primalry i manage wordpress websites on GCP cloud platform as a cloud engineer, and create content on passionate things.
you can follow me on youtbe

© 2025 - All Rights Reserved Disclaimer & Privacy Policy