UNIX & Linux Forums

UNIX & Linux Forums (https://www.unix.com/index.php)
-   UNIX for Dummies Questions & Answers (https://www.unix.com/unix-for-dummies-questions-and-answers/)
-   -   Creating FTP account using SSH (putty)? (https://www.unix.com/unix-for-dummies-questions-and-answers/127205-creating-ftp-account-using-ssh-putty.html)

Hayatt 01-06-2010 02:15 PM

Creating FTP account using SSH (putty)?
Hello, : )

I have a remote access to the server that hosts my joomla, and it does not have cpanel.
So I have to do everything manually.

I need to have an FTP account to the httpdocs folder because I need to put these info in the config file of joomla (to allow file uploading ...etc)

So, I googled, and found this:


To create FTP user through SSH you would need to follow below mentioned steps:

1. Login as root through SSH.

2. Next add the user account you want using the 'useradd' command

useradd <username>

3. Now create a special group for that user.

groupadd <groupname>

4. Now to add the user to the group

gpasswd -a <username> <groupname>

These commands are non-standard but available on most popular distributions.
If not, then you can try editing /etc/group using your favorite text editor.

5. Change the group ownership of the special directory to that group.

chgrp -R groupname /path/to/your/web/directory

6. Enable write permissions

chmod -R g+rw /path/to/your/web/directory

But I have 2 questions:
1. Shouldn't there be a step to add a password to the account?

2. Step 4 is confusing, it it for adding a password or adding a user to the group?
If it is for both, them wheere should I write down the password? is it instead of -a?

3. path/to/your/web/directory
should I directly write /httpdocs or should I put the whole path from root/....etc

I'm really new to Linux.

Any help is appreciated.

TonyFullerMalv 01-06-2010 02:40 PM

1. Yes, run "passwd <userame>" as root user will do that for you.

2. Yes, it is not how I would do it, I would just edit /etc/group and add the user to that group's line preceded by a comma if users are already in that group, the user will have to log off and back on again to see the new group membership, or take a look at:
How To: UNIX Add A User To A Group

3. Yes.


Hayatt 01-06-2010 05:33 PM

Thanks Tony for the quick reply.

1. So after I finish I should run this:
passwd <userame>
Where should I put the password?
Like this:
passwd <userame> mypassword

2. I'm reading the article, Thanks.
But I think I'll be back with questions.

3. Yes, mean the whole path, or just the directory "httpdocs"?

Thanks again :)

TonyFullerMalv 01-06-2010 07:15 PM

1. No the passwd command will ask you for the password twice after hitting the enter key, providing a password as a command line parameter is not good security practice and does no work with the passwd command.

3. Sorry, yes, the whole path.

Hayatt 01-07-2010 03:47 PM

Hi Tony.

Everything was Ok until this step:

gpasswd -a <username> <groupname>

I wrote it exactly as it is:
gpasswd -a myusername thegroup

but it gave me an error message that this command is not right, or something like that. :S

Is there any other command I can use?
My server uses Suse11 a.


Corona688 01-07-2010 04:56 PM

If you don't have that command, install it. If you do but it doesn't work, tell us what the error actually says.

TonyFullerMalv 01-07-2010 05:10 PM

I admit I have never heard of gpasswd, I would either edit /etc/group or add the user to the secondary group when caliing useradd, that is -G <secondarygroup>.

According to this article:
gpasswd(1) should already be installed on your SUSE installation.

All times are GMT -4. The time now is 06:37 PM.

UNIX and Linux Forums
Search Engine Optimisation provided by DragonByte SEO v2.0.32 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Unix & Linux Forums Content Copyright©1993-2017. All Rights Reserved.
Forum Operations by The UNIX and Linux Forums