LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-29-2016, 11:21 AM   #1
helmet1980
Member
 
Registered: Apr 2016
Distribution: Debian
Posts: 40

Rep: Reputation: Disabled
Cool sftp doesn't work...


Hi everybody, this is the message.

Connecting to localhost...
ssh: connect to host localhost port 22: Connection refused
Couldn't read packet: Connection reset by peer

I try to connect to my localhost like this

sftp "gnome@localhost" and I have no idea what's going on.
Thank you so much in advanced.
 
Old 04-29-2016, 12:23 PM   #2
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,215

Rep: Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849
Quote:
Connecting to localhost...
ssh: connect to host localhost port 22: Connection refused
Couldn't read packet: Connection reset by peer
This type of message can be generated because sshd is not configured, or not running.

Port 22 is the standard port ssh uses.

Open a terminal and run the command 'ps aux | grep sshd'. Type just what is between the quotes, not the quotes. Post the results here.

Next, is gnome a valid user name? You have to use a valid user name.

It would also help if you posted the distro you are using, the version and what you have done so far to resolve the problem.

BTW, I tried this on my system, with sshd running, and it connects.
 
Old 04-29-2016, 12:55 PM   #3
helmet1980
Member
 
Registered: Apr 2016
Distribution: Debian
Posts: 40

Original Poster
Rep: Reputation: Disabled
I use CentOS 6.7
The output of ps is this
root 4079 0.0 0.0 103308 860 pts/0 S+ 13:46 0:00 grep sshd

[gnome@debian ~]$ This is the prompt.
 
Old 04-29-2016, 01:06 PM   #4
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,215

Rep: Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849
sshd is not running. I would suggest you look at Centos doc to find out how to configure and start it. The configuration file is called sshd_config. It is located in /etc/ssh/ on my system. Yours could have a different location. I find the defaults work, so I don't think you need to much to it.

I run Slackware, so I'm not familiar with how Centos starts daemons.

One last thought, is your system running a firewall? If yes, port 22 needs to be open for this to work.
 
Old 04-29-2016, 01:34 PM   #5
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Code:
sudo service sshd start
 
Old 04-29-2016, 03:27 PM   #6
helmet1980
Member
 
Registered: Apr 2016
Distribution: Debian
Posts: 40

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by camorri View Post
sshd is not running. I would suggest you look at Centos doc to find out how to configure and start it. The configuration file is called sshd_config. It is located in /etc/ssh/ on my system. Yours could have a different location. I find the defaults work, so I don't think you need to much to it.

I run Slackware, so I'm not familiar with how Centos starts daemons.

One last thought, is your system running a firewall? If yes, port 22 needs to be open for this to work.
Thank you so much. Very accurate.
 
Old 04-29-2016, 03:28 PM   #7
helmet1980
Member
 
Registered: Apr 2016
Distribution: Debian
Posts: 40

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Habitual View Post
Code:
sudo service sshd start
It works like heaven. Thank you so much.
 
Old 04-29-2016, 03:42 PM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
localhost is the local loopback adapter i.e. 127.0.0.1 which always refers to the computer you are currently using. If you are trying to connect to another computer on your network then use its IP address i.e.

sftp username@IP_Address

Since you posted two different prompts it appears you are trying to connect to a remote computer? Make sure the ssh server is running on the computer you are trying to connect to. How to start the service depends on distribution / version. And also change the firewall so it allows incoming ssh connections.

If my assumptions are not correct please post additional information on what you are trying to accomplish.
 
Old 04-29-2016, 04:01 PM   #9
ardvark71
LQ Veteran
 
Registered: Feb 2015
Location: USA
Distribution: Lubuntu 14.04, 22.04, Windows 8.1 and 10
Posts: 6,282
Blog Entries: 4

Rep: Reputation: 842Reputation: 842Reputation: 842Reputation: 842Reputation: 842Reputation: 842Reputation: 842
Quote:
Originally Posted by helmet1980 View Post
It works like heaven. Thank you so much.
Hi...

Heaven is a lot better!

If you would, please mark this thread as "SOLVED" by clicking on "Thread Tools" directly above your initial post. Thanks!

Regards...
 
Old 04-30-2016, 07:30 PM   #10
helmet1980
Member
 
Registered: Apr 2016
Distribution: Debian
Posts: 40

Original Poster
Rep: Reputation: Disabled
Cool

Quote:
Originally Posted by ardvark71 View Post
Hi...

Heaven is a lot better!

If you would, please mark this thread as "SOLVED" by clicking on "Thread Tools" directly above your initial post. Thanks!

Regards...
Ok, it's marked as solved. Thanks for the comment.
 
Old 04-30-2016, 07:41 PM   #11
helmet1980
Member
 
Registered: Apr 2016
Distribution: Debian
Posts: 40

Original Poster
Rep: Reputation: Disabled
Cool

Quote:
Originally Posted by michaelk View Post
localhost is the local loopback adapter i.e. 127.0.0.1 which always refers to the computer you are currently using. If you are trying to connect to another computer on your network then use its IP address i.e.

sftp username@IP_Address

Since you posted two different prompts it appears you are trying to connect to a remote computer? Make sure the ssh server is running on the computer you are trying to connect to. How to start the service depends on distribution / version. And also change the firewall so it allows incoming ssh connections.

If my assumptions are not correct please post additional information on what you are trying to accomplish.
Ok, thanks for the information, it's very helpful.
 
Old 05-01-2016, 12:02 AM   #12
ardvark71
LQ Veteran
 
Registered: Feb 2015
Location: USA
Distribution: Lubuntu 14.04, 22.04, Windows 8.1 and 10
Posts: 6,282
Blog Entries: 4

Rep: Reputation: 842Reputation: 842Reputation: 842Reputation: 842Reputation: 842Reputation: 842Reputation: 842
Quote:
Originally Posted by helmet1980 View Post
Ok, it's marked as solved. Thanks for the comment.
You're more than welcome

Regards...
 
Old 05-01-2016, 06:04 AM   #13
tshikose
Member
 
Registered: Apr 2010
Location: Kinshasa, Democratic Republic of Congo
Distribution: RHEL, Fedora, CentOS
Posts: 525

Rep: Reputation: 95
Hi,

I know it is marked as SOLVED, but as your sshd was not running, it might not be configured to start after boot.
So you also need to run
Code:
chkconfig sshd on
 
Old 05-01-2016, 03:24 PM   #14
helmet1980
Member
 
Registered: Apr 2016
Distribution: Debian
Posts: 40

Original Poster
Rep: Reputation: Disabled
Cool

Quote:
Originally Posted by tshikose View Post
Hi,

I know it is marked as SOLVED, but as your sshd was not running, it might not be configured to start after boot.
So you also need to run
Code:
chkconfig sshd on
It works very well. Thanks a lot.
 
  


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
ssh login works but sftp doesn't... koyi Linux - Networking 10 03-12-2020 08:44 AM
I'm defeated: Can't get SCP to work in chroot jail (but sftp and ssh work fine) ponga Linux - Security 2 09-30-2011 11:06 AM
Keyboard doesn't work right click on mouse doesn't work ramblinrick Linux Mint 2 10-15-2010 01:10 AM
SFTP - CyberDuck doesn't work, but WinSCP does? Server exited on signal "PIPE"? dragos19 Other *NIX 1 10-04-2008 04:52 PM
sftp doesn't work in Konqueror after SSH/SSL upgrade Supernaut Slackware 4 10-28-2003 02:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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