LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-05-2014, 10:31 AM   #31
fortran
Member
 
Registered: Nov 2011
Location: Cairo, Egypt
Distribution: CentOS, RHEL, Fedora
Posts: 300
Blog Entries: 2

Rep: Reputation: 51

If you are on server's terminal, can you connect to your system from server?
You haven't told your linux distribution of your server. I am assuming it is debian based.
Open server's terminal and run
Quote:
sudo /etc/init.d/ssh restart
if still it does not restart it, now run
Quote:
which service
what is output of it.
These all commands you need to run on server's terminal.

If you are not able to connect to server using ssh then you can not run these commands on server's command prompt from your system.
You need to open server's terminal physically and run these commands there.

Last edited by fortran; 08-05-2014 at 10:32 AM.
 
Old 08-05-2014, 10:50 AM   #32
Noobie1212
LQ Newbie
 
Registered: Aug 2014
Posts: 25

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by fortran View Post
If you are on server's terminal, can you connect to your system from server?
You haven't told your linux distribution of your server. I am assuming it is debian based.
Open server's terminal and run

if still it does not restart it, now run

what is output of it.
These all commands you need to run on server's terminal.

If you are not able to connect to server using ssh then you can not run these commands on server's command prompt from your system.
You need to open server's terminal physically and run these commands there.
Quote:
sudo /etc/init.d/ssh restart
gives this error:
Quote:
sudo: /etc/init.d/ssh: command not found
while this doesn't give any results.
Quote:
which service
I used to be able to connect like this, this morning I used
Quote:
sudo service ssh restart
to restart the ssh and ever since then this hasn't worked.

How do I physically open the terminal?
 
Old 08-06-2014, 03:11 AM   #33
Noobie1212
LQ Newbie
 
Registered: Aug 2014
Posts: 25

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by fortran View Post
If you are on server's terminal, can you connect to your system from server?
You haven't told your linux distribution of your server. I am assuming it is debian based.
Open server's terminal and run

if still it does not restart it, now run

what is output of it.
These all commands you need to run on server's terminal.

If you are not able to connect to server using ssh then you can not run these commands on server's command prompt from your system.
You need to open server's terminal physically and run these commands there.
I'm really sorry to ask but I've still not managed to get this sorted. Would you mind talking me through doing this from the very beginning? I'm more than happy to pay for your help but I'm so desperate to get this sorted.

Thank you
 
Old 08-06-2014, 03:20 AM   #34
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
Hi,

as far as I can tell you still haven't answered questions that you've been asked. First off what distro is this? The output of the following command should provide that information
Code:
lsb_release --all
Evo2.
 
Old 08-06-2014, 04:10 AM   #35
Noobie1212
LQ Newbie
 
Registered: Aug 2014
Posts: 25

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by evo2 View Post
Hi,

as far as I can tell you still haven't answered questions that you've been asked. First off what distro is this? The output of the following command should provide that information
Code:
lsb_release --all
Evo2.
I'm sorry I'm not being to be awkward I don't know what distro it is. This is the first time I've ever used this before so don't know how to find out. I know that it was set up using AWS EC2 and runs Ubuntu.

I opened the Terminal then typed that in but it said: -bash: lsb_release: command not found Should I be doing something before I try to type that?
 
Old 08-06-2014, 05:23 AM   #36
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Try
Code:
cat /etc/*release*
 
Old 08-06-2014, 05:58 AM   #37
Noobie1212
LQ Newbie
 
Registered: Aug 2014
Posts: 25

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by chrism01 View Post
Try
Code:
cat /etc/*release*
That just gave me this: cat: /etc/*release*: No such file or directory

Sorry to be so dumb but can we go right back to the beginning as I'm sure I'm doing something wrong.

If I open Terminal what should be the first thing I should do?

I'm more than happy to pay for help to get this fixed but I really need to get it sorted asap as my boss keeps asking about when they can see the changes and I can't upload anything at all at the moment
 
Old 08-06-2014, 06:18 AM   #38
Smokey_justme
Member
 
Registered: Oct 2009
Distribution: Slackware
Posts: 534

Rep: Reputation: 203Reputation: 203Reputation: 203
I don't get what's all this hasle..

Unfortunatly, you've looked yourself out because the new port is firewalled...

Basically, you modified the port on which sshd service is running but you did not allow that port to accept connections on the server..

That is why you get "Connection refused" when trying to acces port 22 (which the firewall allows the connection but the port is unbinded and a reject is sent by the system -- it resembles a closed port) and you get a "Request timeout" when accesing port 1993 because the firewall simply drops all packets to that port and gives no further answer ..

The only way to fix this is by gaining acces to the server itself because SSH is now out of the question.. If you have such access or have any other means to gain such access to a terminal on the server, well, then we can help..
 
Old 08-06-2014, 06:24 AM   #39
Noobie1212
LQ Newbie
 
Registered: Aug 2014
Posts: 25

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Smokey_justme View Post
I don't get what's all this hasle..

Unfortunatly, you've looked yourself out because the new port is firewalled...

Basically, you modified the port on which sshd service is running but you did not allow that port to accept connections on the server..

That is why you get "Connection refused" when trying to acces port 22 (which the firewall allows the connection but the port is unbinded and a reject is sent by the system -- it resembles a closed port) and you get a "Request timeout" when accesing port 1993 because the firewall simply drops all packets to that port and gives no further answer ..

The only way to fix this is by gaining acces to the server itself because SSH is now out of the question.. If you have such access or have any other means to gain such access to a terminal on the server, well, then we can help..
Thank you, I have access to the AWS console if that helps. I'm happy to try anything....
 
Old 08-06-2014, 06:33 AM   #40
Smokey_justme
Member
 
Registered: Oct 2009
Distribution: Slackware
Posts: 534

Rep: Reputation: 203Reputation: 203Reputation: 203
It should help but I'm not familiar with it and can't really help you out because of this.. Basically search if it can access the server's file-system and allows you to do a restart, then you're golden... just modify the SSH service back to port 22 and restart the server.. Or maybe it can directly modify the firewall? Or restart services (thus not needing a full restart of the (virtual) server).. I don't know exactly what AWS Console can do but any of these should be fine..

Last edited by Smokey_justme; 08-06-2014 at 06:35 AM.
 
Old 08-06-2014, 08:11 AM   #41
fortran
Member
 
Registered: Nov 2011
Location: Cairo, Egypt
Distribution: CentOS, RHEL, Fedora
Posts: 300
Blog Entries: 2

Rep: Reputation: 51
Go to your EC2 AWS Console, under NETWORK & SECURITY click on Security Group, It will show up the security group you saw before. Click on it, it will show a split screen where the one is above has 2 tabs: Details and Inbound. Go to Inbound, in port range input 22 and source the ip you want to allow incoming access to instance. Don't forget to apply changes.
http://docs.aws.amazon.com/gettingst...ity-group.html

Last edited by fortran; 08-06-2014 at 08:15 AM.
 
Old 08-06-2014, 08:40 AM   #42
Noobie1212
LQ Newbie
 
Registered: Aug 2014
Posts: 25

Original Poster
Rep: Reputation: Disabled
I've now managed to connect using FileZilla, but if I type
Code:
./deploy.sh livesite
into the terminal I get this error:

Quote:
./deploy.sh livesite ssh: connect to host 12.34.5.678 port 22: Connection refused rsync: connection unexpectedly closed (0 bytes received so far) [sender] rsync error: unexplained error (code 255) at /SourceCache/rsync/rsync-42/rsync/io.c(452) [sender=2.6.9]
How do I use ./deploy.sh livesite to connect via SSH?
 
Old 08-06-2014, 08:49 AM   #43
fortran
Member
 
Registered: Nov 2011
Location: Cairo, Egypt
Distribution: CentOS, RHEL, Fedora
Posts: 300
Blog Entries: 2

Rep: Reputation: 51
Because still the port 22 is not opened on your server. You need to open it using AWS console what mentioned in above url.
 
Old 08-06-2014, 09:32 AM   #44
Noobie1212
LQ Newbie
 
Registered: Aug 2014
Posts: 25

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by fortran View Post
Because still the port 22 is not opened on your server. You need to open it using AWS console what mentioned in above url.
So does that mean that I have to have port 22 open then in order to use SSH? Or do you just mean that port 22 has to be open on the server (not in the sshd_config file?
 
Old 08-06-2014, 09:33 AM   #45
fortran
Member
 
Registered: Nov 2011
Location: Cairo, Egypt
Distribution: CentOS, RHEL, Fedora
Posts: 300
Blog Entries: 2

Rep: Reputation: 51
You need to open port 22 in the ec2 Security Group. Also need to open the same port on the EC2 instance's firewall.
 
  


Reply



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
Initiate ssh tunnel to connect to ssh? brianmcgee Linux - Security 2 09-07-2011 10:07 AM
Able to connect via SSH but not able to connect via web port 80 Orange Sunshine Linux - Server 9 04-03-2010 07:11 PM
iptables help! DROP ssh port, but allow to connect to ssh if from 2222 port kandzha Linux - Networking 4 09-13-2006 09:10 AM
ssh + pop3 with kmail: Could not connect to host localhost, but ok without ssh Emmanuel_uk Linux - Networking 0 07-20-2006 04:56 PM
Can't connect via ssh _TK_ Linux - Networking 3 04-27-2001 06:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:35 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