LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Questions about ftp (https://www.linuxquestions.org/questions/linux-newbie-8/questions-about-ftp-325828/)

UnforgotteN 05-21-2005 09:56 PM

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!

JimBass 05-21-2005 11:05 PM

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

UnforgotteN 05-23-2005 12:45 AM

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!

Alien#007 05-23-2005 01:18 AM

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.

UnforgotteN 05-23-2005 11:20 PM

Thank you SO much!


All times are GMT -5. The time now is 02:45 PM.