Question about SSH

  • Majd-GFX
  • Novice
  • Novice
  • Majd-GFX
  • Posts: 27
  • Loc: MI, USA

Post 3+ Months Ago

i think this is the right section for this question...


anyways.

i am really struggeling with setting up my VPS server which i have gotten from tektonic.net.

so my question is:

support told me to add an ftp user i put: useradd -n name -p password -g ftpusers

which worked.

now i need to give the user i created root permissions so i can upload and change htaccess and http.conf or w/e

so how do i change the ftp permissions of a user?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Xel02
  • Proficient
  • Proficient
  • Xel02
  • Posts: 261

Post 3+ Months Ago

Depends on what you mean by root permissions. If you want to allow the user to become root, on certain distributions (like *BSD) you need to add the user to the Wheel user group. Others allow you to do it without doing anything special.

You can then become root by doing 'su' in a shell, without quotes.

If you simply want to allow the user to have read/write/execute access to certain files. As in do whatever they want to those files, you can login as root or the normal user and then go to the file and do a 'chown ftpuser [filename]'

This will give owner priviledges to ftpusers, which is usually 7 (do whatever they want).

Thats one way or you can add ftpusers to the same group as the owner (the normal user) and then do a 'chmod g+rwx [filename]' this changes the groups priviledges to read/write/execute.

The best way I believe would be by adding ftpusers to the same group as the owner.

Hope this helps.
  • Majd-GFX
  • Novice
  • Novice
  • Majd-GFX
  • Posts: 27
  • Loc: MI, USA

Post 3+ Months Ago

yes actually it does. but my question to you now is...

All i need to do to add a user to the same group as root is add

chmod g+rwx [filename] in putty while logged in as the root user? (putty is the ssh thing that's provided by the hosting company)

if so, then how do i give the person permissions to a whole directory, and not just a file?

EDIT: also, when you say [filename] do you mean path? or just name.extension?


EDIT EDIT: ok i finally startin to figure this out...

i finally found a decent tutorial. Now here's what i did.
1) i edit user (majd) and set primary and secondary groups to group root
2) i added majd to the user list in group root.

i logged in to ftp, tried to edit httpd.conf but i got permission denied or smthn...
  • Xel02
  • Proficient
  • Proficient
  • Xel02
  • Posts: 261

Post 3+ Months Ago

No to add a user to a group you edit the /etc/group file. You find the group you wish to add the user and at the end of the line there will be a list of users in that group. You simply add the user to it.
Ex. Group:Encrytped Password:GID:Users
So for group ftp without a password it would be:
ftp::102:root, ftpusers

Note. 102 is the GID, you don't really need to worry about it, you just add the name.

For [filename] it's best if its the entire path. Also for a directory just do it the same way as a file.

so /user/username/file works and /user/username/ should also work.

-----------------------------------------------------
So your exact steps would be along the lines of:

1. Decide group that root is in and will own the file
Do this by looking at the /etc/group file and deciding which one is right for this job.

2.Add the user to the group by editing it.

3. Change the group that owns the file with:
chgrp [groupname] [filename]

4. Change the group priviledges
chmod g+rwx [filename]

That should do it. This applies for directories too.
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Posts: 2700
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

Majd-GFX wrote:
i think this is the right section for this question...


anyways.

i am really struggeling with setting up my VPS server which i have gotten from tektonic.net.

so my question is:

support told me to add an ftp user i put: useradd -n name -p password -g ftpusers

which worked.

now i need to give the user i created root permissions so i can upload and change htaccess and http.conf or w/e

so how do i change the ftp permissions of a user?


I could be over-simplifying the issue, but it seems to me that if root needs to own some files which you want an ftp user to edit, simply chamge the group that those files belong to and add that user to that group. (Making that user wheel, so they may become root, will not solve the issue).

As an example, chown root:www <filename>
in /etc/groups add your ftp username to the www group

Now give groups on that file permission to write. chmod g+w

Seems simple enough, unless I am not understanding something.

Cheers.
  • Majd-GFX
  • Novice
  • Novice
  • Majd-GFX
  • Posts: 27
  • Loc: MI, USA

Post 3+ Months Ago

ok so the support replied and told me to user chown and what to type...
here's what i sent back




i put:

chown majd:ftpusers -R ./home/majd/Majd-GFX/

and it gave me failed to get attributes of `./home/majd/Majd-GFX/`

then i tried

chown majd:ftpusers -R ./home/

but that gave me same error

then i tried
chown majd:ftpusers -R ./directory just to see if i have to type the path after that line...but that gave me the same error.....

I am also trying to do this with webmin cause i read somewhere it's doable and i'm guessing easier but i can't figure it out....
  • phpSelectah
  • Student
  • Student
  • User avatar
  • Posts: 97

Post 3+ Months Ago

If you are using linux, use :
Code: [ Select ]
chown majd:ftpusers ./home/majd/Majd-GFX/


as linux does not except the ':' notation in chown commands in certain distros. *BSD doesn't care.

Also, this command will only work if you are in the root directory, as './'
makes your command relative to the directory you are in.


This means if you are in directory /root , ./home/majd/Majd-GFX/ translates to /root/home/majd/Majd-GFX/
which more than likely does not exist.


HtH.

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: No registered users and 62 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.