LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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-21-2005, 10:56 PM   #1
UnforgotteN
LQ Newbie
 
Registered: May 2005
Posts: 16

Rep: Reputation: 0
Questions about ftp


I have root access to my server and i created this folder and upload some files in there, now when i try to acces it using my ftp it says

could not change to the specified folder. Ensure that you have not mistyped the folder name and that you have permissions to access this folder.

How do i change it so i can log in this folder using FTP, also i have some friends i dont want them to write/modify some files in this folder, what do i do so they dont have write permissions for some files.

Thanks Alot!
 
Old 05-22-2005, 12:05 AM   #2
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
The problem is likely caused because you were logged in as root when you created the folder, so the folder and its contents are owned by user root of group root, and the permissions need to be changed to allow non-root folks to see it.

First a forewarning - NEVER allow root access to ftp!! Vsftp is my preferred FTP server, and it wisely doesn't allow root to log in, unless you change its base configs. The problem with allowing root to log in is that anything can be done to your system with root access. Huge security risk, and completely unnescessary.

To allow people other than root to see and access that file, you'll need to use the chmod and chown commands. Before you do anything, give the commands "man chown" and "man chmod" (without the quotes) to your terminal. You should read the pages describing these commands.

I will speculate that you have another user set up on the system, who I'll call user. Since you created the folder as root, you need to be root to change the mods on the file, so sudo or su yourself prior to trying these commands, or they won't work.

Code:
#chown -R user:group /path/to/directory_created_by_root
#chmod 644 /path/to/directory..........
That should clear up your problem. You may have to tweak the individual files as well.

The 644 gives the owner the ablity to read and write the file in question, and the 4 gives everyone else the ability to read the file, but not to write to it. You can use chmod on the directory where the ftp server runs, and the 4 (read only) mod will allow your friends to log on and see the files, but they can't write, so it won't allow them to change it in any way.


Peace,
JimBass
 
Old 05-23-2005, 01:45 AM   #3
UnforgotteN
LQ Newbie
 
Registered: May 2005
Posts: 16

Original Poster
Rep: Reputation: 0
ok frew questions

1.What should i type insted of "user:group". This folder was created by root (me) and its was created inside an account created by Cpanel/Fantastico.

2."so sudo or su yourself prior to trying these commands, or they won't work." what do you mean, im lost here lol....( sorry I'm just starting to learn linux )

3.How do i tweak the individual files inside the folder, using the same codes? those codes work for folders and files as well?

4: 644 is to give read access but not write, what are the other number combinations to give write and read access or to give none.

John,
Thanks Alot!

Last edited by UnforgotteN; 05-23-2005 at 01:46 AM.
 
Old 05-23-2005, 02:18 AM   #4
Alien#007
LQ Newbie
 
Registered: Apr 2004
Location: Slovenia
Distribution: Debian sid, Ubuntu 4.10
Posts: 27

Rep: Reputation: 15
Quote:
1.What should i type instead of "user:group". This folder was created by root (me) and its was created inside an account created by Cpanel/Fantastico.
Instead of user you must put your non-root username that i hope u created. If you haven't then you must create one(man adduser). As for the group. Group defines the groups to which users belong. In one group you can add users for wich you want to have the same privileges.

Quote:
2."so sudo or su yourself prior to trying these commands, or they won't work." what do you mean, im lost here lol....( sorry I'm just starting to learn linux )
Whit su command u can make yourself root if you are logged as normal user. Sudo command allows you to run program as root.

Quote:
3.How do i tweak the individual files inside the folder, using the same codes? those codes work for folders and files as well?
Yes they work for files and folders.(man chmod)

Quote:
4: 644 is to give read access but not write, what are the other number combinations to give write and read access or to give none.
0 - no access
4 - read
2 -write
1 - execute

If you want to give a file or folder mixed combinations you just sum up the numbers. For example you want to give a folder read and write permissions. You just sum up 4 and 2. 4 + 2 = 6.
 
Old 05-24-2005, 12:20 AM   #5
UnforgotteN
LQ Newbie
 
Registered: May 2005
Posts: 16

Original Poster
Rep: Reputation: 0
Thank you SO much!
 
  


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
A couple of questions about ftp g_trueblood Slackware 1 10-24-2005 12:41 PM
ftp questions birv Linux - Newbie 3 01-23-2004 01:55 PM
ftp questions limiter Linux - Networking 3 10-10-2003 02:06 AM
WU-FTP questions syphon00 Linux - Networking 3 09-04-2002 11:07 AM
questions about wu-ftp cywong18 Linux - General 1 05-23-2002 04:37 AM


All times are GMT -5. The time now is 11:11 AM.

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