LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 05-11-2012, 06:55 PM   #1
paruhang
Member
 
Registered: Aug 2011
Location: /home
Posts: 96

Rep: Reputation: Disabled
cannot create a file in my local ftp server


hi everybody,
i cannot create a folder, file and even cannot rename on my local ftp server.

anonymous_enable=NO ( i changed it to NO )
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
listen=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES


# getenforce
Enforcing

#setsebool - P ftp_home_dir=1

# getsebool -a | grep ftp_home_dir
ftp_home_dir --> on

# service vsftpd status
vsftpd (pid 1262) is running...

# groupadd ftpusers

# useradd ashim

# passwd ashim

# pwd
/var/ftp/pub/files

# usermod -aG ftpusers -d /var/ftp/pub/files ashim

# chown root:ftpusers /var/ftp/pub/files

# chmod g+w /var/ftp/pub/files

# service vsftpd restart

i have checked after giving this command
# chown root:ftpusers /var/ftp/pub/files and
# chmod g+w /var/ftp/pub/files

# pwd
/
# ll
drwxr-xr-x. 23 root root 4096 May 11 01:41 var

pwd
/var
# ll
drwxr-xr-x. 3 root root 4096 May 11 01:41 ftp

# pwd
/var/ftp
# ll
drwxr-xr-x. 3 root root 4096 May 12 08:44 pub

# pwd
/var/ftp/pub
# ll
drwxrwxr-x. 2 root ftpusers 4096 May 12 10:03 files




i have install centos in my desktop and windows 7 on my laptop.

1) (from windows) i can download a file but when try to upload data in ftpserver=10.10.10.161 "/var/ftp/pub/files from my client laptop using windows 7 os the following error occurs

550 create directory operation failed



2) (in centos) when i try to make directory inside /var/ftp/pub/files/ the error occurs

# ftp 10.10.10.161
Connected to 10.10.10.161 (10.10.10.161).
220 (vsFTPd 2.2.2)
Name (10.10.10.161:khem): ashim
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pwd
257 "/var/ftp/pub/files"
ftp> mkdir test
550 Create directory operation failed.
ftp>

hostname = server and my ip = 10.10.10.161. when i do ftp://10.10.10.161 it works but when i try ftp://server it does not work.


i have menson the setp's i have done but i was not able to upload a file , create a file and rename a file. can anybody guide me in right way i'll be greatful and any kinds of ideas, suggestions and guidelines are welcome.

THANK YOU IN ADVANCE;

Last edited by paruhang; 05-11-2012 at 07:09 PM.
 
Old 05-11-2012, 08:46 PM   #2
ExemptOA
LQ Newbie
 
Registered: May 2012
Posts: 13

Rep: Reputation: Disabled
I recently tried doing this but after much reading and editing i found it extremely tedious.

One thing i found you need to do however is once you FTP into your server "ftp:10.10.10.161port number)" you need to authenticate by right clicking in the FTP folder window and clicking login. You will then use your system credentials to log in. Unless you have it set up correctly, the user you authenticate with must be a real user on the server.

So if on your server, you have a user called, "Server", and that user has a valid password, you will need to enter that information in in order to have full read/write/execute access.
 
Old 05-12-2012, 10:51 AM   #3
paruhang
Member
 
Registered: Aug 2011
Location: /home
Posts: 96

Original Poster
Rep: Reputation: Disabled
thank you, ExemptOA.
for your quick reply. what i want to do is just want to create folder , rename and edit by logging in specific user which i have login.

when i switch to # setenforce 0. i can create, rename and edit file but when i switch to # setenforce 1 i cannot able to create, rename and edit file . i think i have to manage selinux but i don't know where and how to do this.

can anybody help me to fix my problems any kinds of ideas, suggestions are welcome and i'll be greatful.

THANK YOU IN ADVANCE.
 
Old 05-13-2012, 08:01 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.x
Posts: 18,434

Rep: Reputation: 2790Reputation: 2790Reputation: 2790Reputation: 2790Reputation: 2790Reputation: 2790Reputation: 2790Reputation: 2790Reputation: 2790Reputation: 2790Reputation: 2790
Some good SELinux explanations/howtos in this doc http://www.linuxtopia.org/online_boo...ion/index.html.
Mostly you'll want Chap 44; see Chap 43 for background theory.
 
  


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
How to create a local mail archive server? (or is it possible) vishyc88 Linux - Server 6 03-21-2012 07:07 AM
ftp user can't create a directory on ftp server bharatlalgupta Red Hat 4 01-27-2010 01:58 PM
'553 Could not create file' in vsftpd FTP Server on CentOS 5 Fabian10 Linux - Server 2 11-26-2007 11:13 AM
FTP Server Up and running... how do I hide ftp users from local login screen? joe1031 Mandriva 2 03-18-2005 04:24 PM

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

All times are GMT -5. The time now is 03: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
Open Source Consulting | Domain Registration