Telnet: Traditional way to connect Remote Host
Overview,
Telnet
is an OSIApplication Layer
protocol used to provide abidirectional interactive text-oriented communication facility
overnetwork
using a virtualterminal connection
.Telnet
provids access to acommand-line interface
of an operating system on a remote host/router.Telnet
uses TCPport 23
by default.
Generally,
- The term
telnet
is used to refer to the software that implements the client part of the protocol. - The term
telnetd
is used to refer to the software that implements the server part of the protocol.
Installation,
- Execute
$> sudo apt-get install telnetd
in case ofUbuntu
and$> sudo yum install telnetd
in case ofCentos
to install telnet server on remote host. - For client, use
telnet
commnad , a built-in telnet client, from host you want telnet to server.
Now you can establish remote connection using command,
$> telnet remote_host/ip 23
Then you will get a terminal session to remote host’s terminal where you can execute any comand for remote host.
Disadvantag,
- Accessing a remote terminal through telnet program is unsecure since everything that you send or receive over that telnet session is visible in plain text. So anyone who can “sniff” (eg. using tools like
Wireshark
ortcpdump
) the connection in-between can see your stuffs. - For this reason we need a more sophisticated program than telnet to connect to a remote host, ie. SSH :) .
- N/W administrator can use tcpdump for capturing packtes and Wireshark to view/analyse the packets. eg.
tcpdump port 23 -w dump.txt
andwireshark dump.txt
SSH: Modern way to connect Remote Host
Overview,
- SSH provides
encrypted session
,authentication facilities
,secure file transfer(SCP|sftp)
,X session forwarding
, andport forwarding
etc. SSH
is an OSIApplication Layer
protocol used to provide abidirectional interactive text-oriented communication facility
overnetwork
using a virtualterminal connection
.SSH
provids access to acommand-line interface
of an operating system on a remote host/router.SSH
uses TCPport 22
by default.
Generally,
- The term
ssh
is used to refer to the software that implements the client part of the protocol. - The term
sshd
is used to refer to the software that implements the server part of the protocol.
Installation,
- Execute
$> sudo apt-get install openssh-client
in case ofUbuntu
and$> sudo yum install openssh-client
in case ofCentos
to install telnet server on remote host. - Execute
$> sudo apt-get install openssh-server
in case ofUbuntu
and$> sudo yum install openssh-server
in case ofCentos
to install telnet server on remote host. - Generate private and public key using
$> ssh-keygen -t rsa
- Copy your public key to server using
$> ssh-copy-id user@remotehost
- Change the permission using
$> chmod 600 .ssh/authorized_keys
Now you can establish remote connection using command,
$> ssh -i private_key user@remote_host
Then you will get a terminal session to remote host’s terminal where you can execute any comand for remote host.
More on SSH,
X11 Session Forwarding
using SSH
- Using this feature of SSH, it’s possible to transmit window and bitmap information over a network connection. So you can login to a remote desktop and run some X windows program like Firefox and the program will run on the remote computer, but will display its graphical output on your local computer.
- For this,
$> ssh -X user@remotehost
where -X option is for X11 session forwarding.
TCP Port Forwarding
You can setup a port forward from your localhost to remotehost so that it will take connections to localhost port 3306 and forward them to the remote side port 3306. This way MySQL server would allow you to run GUI MySQL programs on your local computer while using the database on your remotehost.
Here is the command to accomplish this:
$> ssh -L 3306:mysql.remotehost:3306 user@remotehost
The -L (Local port) takes one argument of
<local-port>:<connect-to-host>:<connect-to-port>
This is a kind of VPN connection.
Running Shell script/commands on Remote Host
Sometimes you don’t really want to run a shell like Bash on the host you are connecting to. Maybe you just want to run a command and exit. This is very simply accomplished by putting the command you wish to run at the end of your ssh connection command.
$> ssh user@remotehost "ls -l /"
Or more conveniently,
$ ssh -i /path_to_private_key -o ConnectTimeout=10 -o ServerAliveInterval=60
-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/ null
-o StrictHostKeyChecking= no
user@remotehost "your script or commands to be executed on remote host"
Screen
Tool with SSH for remote connection management
This tool can be your best friend if you are remote administrator or you work on remote terminal for long time. This helps to maintain multiple remote session on single screen and can be resumed the session even after connection disruption.
Installation:
Ubuntu: $> sudo apt-get install screen
CentOS: $> sudo yum install screen
Commands,
$> screen
to open the screen
$> exit
to quit screen
$> screen -S name_of_screen
to open the named screen
$> screen -ls
to see the list of screens
Ctrl a" "d"
to detach from screen
$> screen -rx name_of_screen
to reattach the already created screen
Ctrl a" "c"
to create a tab inside the screen
"Ctrl-a" "n"
to switch between tabs of same screen
30 comments
I must thank you for the efforts you have put in penning this site. I am hoping to check out the same high-grade content by you later on as well. In truth, your creative writing abilities has inspired me to get my own, personal blog now..
Linux Training in Chennai
Really nice and definitely it will be useful for many people. Kindly keep update like this.
SAS Training in Chennai
Great site for these post and i am seeing the most of contents have useful for my Carrier.Thanks to such a useful information.Any information are commands like to share him.
Branding Services in Chennai
Nice Post....
Red Hat Linux Training in Chennai
Good explanation of the topic
Sanjary Kids is one of the best play school and preschool in Hyderabad,India. Give your child the best preschool experience by choosing the best playschool of Hyderabad in Abids. we provide programs like Play group,Nursery,Junior KG,Senior KG,and provides Teacher Training Program.
pre and primary teacher training course in hyderabad
Thanks for sharing
Yaaron Studios is one of the rapidly growing editing studios in Hyderabad. We are the best Video Editing services in Hyderabad. We provides best graphic works like logo reveals, corporate presentation Etc. And also we gives the best Outdoor/Indoor shoots and Ad Making services.
Best video editing services in Hyderabad,ameerpet
Best Graphic Designing services in Hyderabad,ameerpet
Best Ad Making services in Hyderabad,ameerpet
Students अपने विश्वविद्यालयों के Results के बारे में नवीनतम अपडेट की जाँच करें। Timetable-Result.com यह साइट आपकी सभी क्वेरी को समझने में मदद करेगी है।
BA Exam result Part 1st, 2nd, Final Year
BCom Exam result 1st, 2nd, 3rd semester
Eskişehir
Adana
Sivas
Kayseri
Samsun
LUP
yozgat
sivas
bayburt
van
uşak
Y6K
sinop
sakarya
gümüşhane
amasya
kilis
L4GK6
whatsapp görüntülü show
ücretli.show
GRRA
whatsapp görüntülü show
ücretli.show
İXPYBD
rize evden eve nakliyat
muğla evden eve nakliyat
kırıkkale evden eve nakliyat
mardin evden eve nakliyat
istanbul evden eve nakliyat
KFS
1A8E7
Sivas Parça Eşya Taşıma
Hatay Evden Eve Nakliyat
Ardahan Parça Eşya Taşıma
Sivas Lojistik
Hakkari Lojistik
3AC3E
Bursa Evden Eve Nakliyat
Tekirdağ Evden Eve Nakliyat
Aksaray Evden Eve Nakliyat
Adıyaman Evden Eve Nakliyat
Rize Evden Eve Nakliyat
AEFE7
Sivas Şehirler Arası Nakliyat
Çerkezköy Halı Yıkama
Çorum Şehirler Arası Nakliyat
Ünye Parke Ustası
Yalova Evden Eve Nakliyat
Kars Parça Eşya Taşıma
Burdur Parça Eşya Taşıma
Çerkezköy Çelik Kapı
Kucoin Güvenilir mi
AFB78
Uşak Evden Eve Nakliyat
Edirne Evden Eve Nakliyat
Ünye Yol Yardım
Isparta Şehir İçi Nakliyat
Aksaray Şehir İçi Nakliyat
Osmaniye Şehir İçi Nakliyat
Osmaniye Parça Eşya Taşıma
Alya Coin Hangi Borsada
Çerkezköy Oto Elektrik
F051C
Iğdır Şehir İçi Nakliyat
Çankaya Parke Ustası
Kastamonu Lojistik
Eskişehir Şehirler Arası Nakliyat
Konya Lojistik
Silivri Fayans Ustası
İzmir Lojistik
Tekirdağ Şehir İçi Nakliyat
Bitget Güvenilir mi
0D4CC
Trabzon Şehirler Arası Nakliyat
Shibanomi Coin Hangi Borsada
İstanbul Evden Eve Nakliyat
Expanse Coin Hangi Borsada
Mith Coin Hangi Borsada
Tokat Evden Eve Nakliyat
Eskişehir Şehir İçi Nakliyat
Manisa Lojistik
Pitbull Coin Hangi Borsada
0B966
testosterone propionat for sale
Mersin Evden Eve Nakliyat
Ardahan Evden Eve Nakliyat
Batman Evden Eve Nakliyat
Denizli Evden Eve Nakliyat
Amasya Evden Eve Nakliyat
Çanakkale Evden Eve Nakliyat
Bingöl Evden Eve Nakliyat
Çankırı Evden Eve Nakliyat
98CD4
%20 referans kodu
9BD0D
binance
A81F3
Denizli Sesli Sohbet Mobil
tunceli kızlarla canlı sohbet
bartın rastgele canlı sohbet
maraş sesli sohbet sitesi
bilecik mobil sohbet odaları
malatya sohbet
rastgele görüntülü sohbet uygulaması
zonguldak rastgele sohbet siteleri
Bilecik Rastgele Görüntülü Sohbet Uygulamaları
E8C62
Binance Ne Kadar Komisyon Alıyor
Mexc Borsası Kimin
Coin Nedir
Mexc Borsası Kimin
Snapchat Takipçi Satın Al
Milyon Coin Hangi Borsada
Xcn Coin Hangi Borsada
Coin Kazma Siteleri
Coin Para Kazanma
4351D
Kripto Para Nasıl Alınır
Coin Nasıl Üretilir
Binance Hesap Açma
Binance Hesap Açma
Tumblr Takipçi Satın Al
Kripto Para Madenciliği Siteleri
Spotify Takipçi Hilesi
Binance Ne Zaman Kuruldu
Bee Coin Hangi Borsada
29E63
uniswap
shiba
quickswap
dexscreener
dextools
layerzero
poocoin
aave
solflare
66989
Kayseri İftar Saatleri
Diyarbakır İftar Saatleri
Burdur İftar Saatleri
Bingöl İftar Saatleri
Mardin İftar Saatleri
Hakkari İftar Saatleri
Kırşehir İftar Saatleri
Nevşehir İftar Saatleri
Bolu İftar Saatleri
Great and I have a super supply: Whole House Reno whole home renovation