LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 03-10-2012, 10:24 AM   #1
landog
LQ Newbie
 
Registered: Jan 2006
Posts: 23

Rep: Reputation: 0
FTP or SCP to CentOS


need to transfer files from a windows computer to a CentOS server. I was planning on using WinSCP to do so. I would like to learn how to get the server configured correctly to accept SCP or FTP connections.

I have installed Centos 6.2 from a LiveDVD to a hard drive.

I was following the instructions found here: http://www.cyberciti.biz/faq/centos-ssh/

I have run these commands:
yum install openssl
yum -y install openssh-server openssh-clients
chkconfig sshd on
service sshd start

I have edited /etc/sysconfig/iptables and added this line:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT

when i restart iptables with:
service iptables restart
..I receive an error: "iptables-restore: line 12 failed"
Line 12 is the line that I added.

Any help and advice is appreciated.

Thanks,
-dog
 
Old 03-10-2012, 10:31 AM   #2
devilboy09
Member
 
Registered: Nov 2011
Location: Iran
Distribution: Debian, CentOS, LFS, CloudLinux
Posts: 377

Rep: Reputation: 8
so you have a problem with iptables.what command did you issue or you just edit the file ?
my suggestion is : to erase that line and then issue this commands :
Code:
iptables -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
service iptables save
service iptables restart
and i don't know if RH-Firewall-1-INPUT is a default chain, but if it is not you can create it like this:
Code:
iptables -N RH-Firewall-1-INPUT
 
Old 03-10-2012, 10:57 AM   #3
landog
LQ Newbie
 
Registered: Jan 2006
Posts: 23

Original Poster
Rep: Reputation: 0
Thanks for your reply...
Quote:
Originally Posted by devilboy09 View Post
so you have a problem with iptables.what command did you issue or you just edit the file ?
my suggestion is : to erase that line and then issue this commands :
Code:
iptables -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
After doing so, I get: "No chain/target/match by that name"

Quote:
and i don't know if RH-Firewall-1-INPUT is a default chain, but if it is not you can create it like this:
Code:
iptables -N RH-Firewall-1-INPUT
I did that and then repeated your 1st suggestion. I still get: "No chain/target/match by that name"
 
Old 03-10-2012, 11:15 AM   #4
landog
LQ Newbie
 
Registered: Jan 2006
Posts: 23

Original Poster
Rep: Reputation: 0
My SCP or FTP connection to my server is denied.
Maybe this sheds some light on the issue?

iptables -L
Quote:
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT)
target prot opt source destination
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Chain RH-Firewall-1-INPUT (0 references)
target prot opt source destination
Thanks,
-dog
 
Old 03-10-2012, 12:45 PM   #5
devilboy09
Member
 
Registered: Nov 2011
Location: Iran
Distribution: Debian, CentOS, LFS, CloudLinux
Posts: 377

Rep: Reputation: 8
try these commands:
Code:
iptables -F
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -P DROP
service iptables save
service iptables restart
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Questions about ssh, ftp, sftp, scp Blackened Justice Linux - Newbie 7 09-23-2011 03:33 PM
Differences between scp and ftp Bucky20 Linux - Newbie 3 02-12-2009 07:45 PM
scp connection problem/ centos 5 mmk2000 Linux - Networking 3 09-17-2007 10:46 AM
ftp/scp tool and technique ufmale Linux - Software 3 07-25-2007 08:11 AM
Ftp or SCP (ssh key) vladoportos Debian 2 02-20-2006 09:58 AM


All times are GMT -5. The time now is 06:44 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration