LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-10-2022, 03:42 PM   #1
LEON71
Member
 
Registered: May 2018
Location: Canada
Distribution: Fedora 38 Workstation
Posts: 87

Rep: Reputation: Disabled
How to Setup and Access a Linux Server Remotely


I have installed Fedora 36 server addition in my spare laptop. How can I access it from another machine remotely ? Is there any documentation for that ? My goal is to test various Ansible commands to this server. I can create small VM using DigitalOcean , Amazon Web Services or Linode. However since I have an extra physical machine I wish set it up as a remote server. Any suggestions ?
 
Old 06-10-2022, 06:48 PM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Quote:
Originally Posted by LEON71 View Post
I have installed Fedora 36 server addition in my spare laptop. How can I access it from another machine remotely ? Is there any documentation for that ? My goal is to test various Ansible commands to this server. I can create small VM using DigitalOcean , Amazon Web Services or Linode. However since I have an extra physical machine I wish set it up as a remote server. Any suggestions ?
Install and run sshd on it. Then ssh to it. Lots of about using ssh and sshd online.

Evo2.
 
Old 06-10-2022, 11:55 PM   #3
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,321
Blog Entries: 3

Rep: Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726
SSH is the way to go. You will have full access to the shell through it and that will give you all the capabilities you would have had sitting at the console itself. The shell is the main system interface which has been refined and advanced for over four decades.

If the server is publicly facing, it would be recommended to use either SSH keys or SSH certificates for authentication and then turn off password authentication.
 
Old 06-12-2022, 04:57 PM   #4
LEON71
Member
 
Registered: May 2018
Location: Canada
Distribution: Fedora 38 Workstation
Posts: 87

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Turbocapitalist View Post
SSH is the way to go. You will have full access to the shell through it and that will give you all the capabilities you would have had sitting at the console itself. The shell is the main system interface which has been refined and advanced for over four decades.

If the server is publicly facing, it would be recommended to use either SSH keys or SSH certificates for authentication and then turn off password authentication.
I tried to access my server machine ( Fedora 36 ) from my work station with the command : ssh root@ip_address_of_my_server_machine.Every time I try to log in I am getting an error message :

WARNING : REMOTE HOST IDENTIFICATION HAS CHANGED !

Please note that I have installed fedora 36 server addition in my spare laptop and trying to ssh it from my another laptop. Is there anything I am missing here ?
 
Old 06-12-2022, 05:04 PM   #5
uteck
Senior Member
 
Registered: Oct 2003
Location: Elgin,IL,USA
Distribution: Ubuntu based stuff for the most part
Posts: 1,173

Rep: Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501
Is the server using an IP you have used before? The error you are getting seems to indicate that it is expecting a different SSH server.
Look in your .ssh/known_hosts for that IP and if you see it, remove its entry. You should be able to connect afterwards.
 
Old 06-12-2022, 06:36 PM   #6
LEON71
Member
 
Registered: May 2018
Location: Canada
Distribution: Fedora 38 Workstation
Posts: 87

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by uteck View Post
Is the server using an IP you have used before? The error you are getting seems to indicate that it is expecting a different SSH server.
Look in your .ssh/known_hosts for that IP and if you see it, remove its entry. You should be able to connect afterwards.
In my server machine I ran this command : ip addr show | grep "inet " and from there I got the inet address. then I tried to ping the server from my workstation using this command :
ping -c1 10.1.1.5 {my inet address is different } and here is what I got as an output :


PING 10.1.1.5 (10.1.1.5) 56(84) bytes of data.
64 bytes from 10.1.1.5: icmp_seq=1 ttl=64 time=6.94 ms

--- 10.1.1.5 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 6.943/6.943/6.943/0.000 ms

but when I tried to ssh 10.1.1.5 I am getting the same error message . please note that I have never connected via ssh from my workstation to the server before.
 
Old 06-12-2022, 06:52 PM   #7
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Quote:
Originally Posted by LEON71 View Post
but when I tried to ssh 10.1.1.5 I am getting the same error message . please note that I have never connected via ssh from my workstation to the server before.
Perhaps not, but is seems that you connected to some other machine with that IP before. Did you check your ~/.ssh/known_hosts file?

Evo2.
 
Old 06-12-2022, 07:01 PM   #8
LEON71
Member
 
Registered: May 2018
Location: Canada
Distribution: Fedora 38 Workstation
Posts: 87

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by evo2 View Post
Perhaps not, but is seems that you connected to some other machine with that IP before. Did you check your ~/.ssh/known_hosts file?

Evo2.
I think you are right! I found two files in my work stations ~/.ssh/ location : known_hosts and known_hosts.old ! now should I remote the IP address of the server from both file ?
 
Old 06-12-2022, 07:05 PM   #9
LEON71
Member
 
Registered: May 2018
Location: Canada
Distribution: Fedora 38 Workstation
Posts: 87

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by LEON71 View Post
I think you are right! I found two files in my work stations ~/.ssh/ location : known_hosts and known_hosts.old ! now should I remote the IP address of the server from both file ?
Never mind . the IP address was stored in known_hosts and I have removed that. now I tried to ssh {IP ADDRESS } again and this time getting this error message : permission denied try again !
 
Old 06-12-2022, 07:16 PM   #10
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Quote:
Originally Posted by LEON71 View Post
Never mind . the IP address was stored in known_hosts and I have removed that. now I tried to ssh {IP ADDRESS } again and this time getting this error message : permission denied try again !
So that likely means one of 3 things.

1. Wrong password
2. Wrong username
3. Wrong IP address

Evo2.
 
Old 06-12-2022, 07:25 PM   #11
LEON71
Member
 
Registered: May 2018
Location: Canada
Distribution: Fedora 38 Workstation
Posts: 87

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by evo2 View Post
So that likely means one of 3 things.

1. Wrong password
2. Wrong username
3. Wrong IP address

Evo2.

I am in ! Actually I have to run an extra command in the server machine : sudo systemctl enable --now sshd
 
Old 06-12-2022, 07:33 PM   #12
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Quote:
Originally Posted by LEON71 View Post
I am in ! Actually I have to run an extra command in the server machine : sudo systemctl enable --now sshd
I don't think that was the solution. That just ensures that sshd will automatically start. It would have already been running otherwise
you wouldn't have seen the permission denied error messages that you reported.

Evo2.
 
1 members found this post helpful.
Old 06-12-2022, 09:38 PM   #13
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,321
Blog Entries: 3

Rep: Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726
Quote:
Originally Posted by LEON71 View Post
I tried to access my server machine ( Fedora 36 ) from my work station with the command : ssh root[b][/b@]ip_address_of_my_server_machine.
Now that you are in, the first thing you need to do is start using SSH keys for authentication and then, once you have confirmed that they work, turn off password access. Note that by default root denies password access and uses only keys for remote login.
 
1 members found this post helpful.
Old 06-12-2022, 11:38 PM   #14
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Root login over ssh generally isn't such a good idea; on my server it's disabled completely.
 
Old 06-12-2022, 11:54 PM   #15
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Quote:
Originally Posted by ondoho View Post
Root login over ssh generally isn't such a good idea; on my server it's disabled completely.
I second this. However, I go one step further and explicitly configure which users may log in using ssh.
Code:
% grep -i '^AllowUsers' /etc/ssh/sshd_config
AllowUsers evo
Evo2.
 
  


Reply

Tags
fedora, linux, server



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
restarting apache and liferay remotely is not working for apache proxy remotely call_krushna Linux - Server 3 05-16-2013 12:13 PM
ubuntu LAMP server, can't access site remotely, locally works by local ip and wan weylin Linux - Newbie 8 04-25-2012 06:37 AM
remotely installing rhel server 6 remotely jwenzel09 Red Hat 2 10-24-2011 08:22 AM
Can I remotely login to remotely display data (remote X-window issue)? polishweasel Linux - Networking 2 06-29-2011 03:21 PM
connect and access files remotely to a samba server over the internet tsh3po Linux - Newbie 7 06-01-2010 06:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration