Enable SFTP on Linux Server

ocpshehzad
ocpshehzad used Ask the Experts™
on
Dear Experts,

1. i am running a Centos6 with Plesk Panel 10. For PCI Compliance I have blocked FTP port21.

2. now when i try to connect through SFTP (port22) using winscp. it gives me this error:
"cannot initialize SFTP protocol. Is host running a SFTP server"

3. what setting/installation i need to do server to make SFTP work?

Regards,
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2007

Commented:
on the server itself, try this

sftp 0

what do you get?

by default ssh is enabled which is also used for sftp.

Author

Commented:
@omarfarid
- i could not understand what i have to do?
- i have already seen these lines while google search but could not get it.

Thanks,

Commented:
Do you have an ssh server instance running ?
Success in ‘20 With a Profitable Pricing Strategy

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Top Expert 2007
Commented:
it means that if you can try to login to the server via console then try to run the command

sftp 0

and login with username and password

this will show ssh / sftp is running locally

Author

Commented:
- i can access server through PuTTY
- from here i can run shell commands
Commented:
You could also use netstat to check if the server is listening on port 22 :

netstat -nta

Open in new window



I'd hazard a guess you don't have openssh installed or if it is on it's not running.




To install ssh server

yum -y install openssh-server openssh-clients

Open in new window


and to start it :

chkconfig sshd on
service sshd start

Open in new window

Commented:
Just thinking here, you use putty to connect to the server, do you use port 22 in there or is it something else ?

As it could be that ssh is listening on a none standard port ...

Also, using putty does not mean that you are connecting using ssh, putty is a client that can be configured in may way, but is primarily known as an ssh client..
Top Expert 2007

Commented:
What does
grep sftp /etc/ssh/sshd_config

Open in new window


display when you run it from the command line?

Author

Commented:
thankyou every  one for your assistance

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial