Solved

SSH LINUX CREATE FTP ACCOUNTS

Posted on 2006-06-27
16
284 Views
Last Modified: 2013-12-16
Ok I have VPS with Linux and I have SSH Root access, need to create more FTP users.  

What is the commands to view list of users on server?

What is the commands to view list of groups on server?

What is the commands to add users on server?

What is the commands to adsign a users to a group on server?

Just need a quick run down on user management from SSH.  Thnx

(Links to other sites with the information would also be great.)
0
Comment
Question by:kwitcom
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 8
16 Comments
 
LVL 22

Expert Comment

by:pjedmond
ID: 16995384
Assuming that the ftp daemon is configured to use /etc/password accounts, then:

>What is the commands to view list of users on server?
cat /etc/passwd | sed s/:.*$//

>What is the commands to view list of groups on server?
cat /etc/group | sed s/:.*$//

>What is the commands to add users on server?
useradd

>What is the commands to adsign a users to a group on server?
usermod

Use man followed by command in order t oget more information.

(   (()
(`-' _\
 ''  ''
0
 

Author Comment

by:kwitcom
ID: 16995559
First two work the list.  But i get errors on the rest.

[root@-------------------]# useradd
bash: useradd: command not found
[root@-------------------]#
[root@-------------------]#usermod
bash: usermod: command not found
[root@-------------------]#

Any Ideas, I login as normal user then i use the command su and enter the root password.
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 16995686
Fine - You haven't got your path settings configured to help you. Try:

/usr/sbin/useradd
/usr/sbin/usermod

If they don't work, then you need to find out where they are on your system.

man useradd
man usermod

Will give you the 'manual information'. If the manual information is there, then I'd guess the command is as well. Just needs you to find it!

Worst case you can use the find command (man find) in order to assist with locating the file concerned. Also bear in mind that these commands are for use by root. If you are not root, then you will not be able to use them.

(   (()
(`-' _\
 ''  ''

0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 

Author Comment

by:kwitcom
ID: 16995781
Ok I found it...
/usr/sbin/useradd

/usr/sbin/useradd -g ftp -p scp2006 scpuser

This should create a user and password in a group
User: scpuser
Pass: scp2006
Group: ftp

But it will not let me login with this user.  Am I missing something?
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 16996396
Possibly......:

As I said "Assuming that the ftp daemon is configured to use (your) /etc/password accounts, then:"

You need to make sure that your ftp server is running correctly and configured correctly to use these passwords.

Also worth noting that you have  a VPS, in which case, you probably do not have any permissions to control and alter the ftp daemon users. If you want to run your own daemon, you'll probably have to run it on a port greater than 1024.

(   (()
(`-' _\
 ''  ''
0
 

Author Comment

by:kwitcom
ID: 17000210
Looks like it is:
CPU        GenuineIntel, Intel(R) Xeon(TM) CPU 2.80GHz
Version       psa v7.5.4_build75051014.16 os_FedoraCore 2
OS       Linux 2.4.20-021stab028.3.777-enterprise
With psa-proftpd running on it for FTP.

Any Ideas?
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 17000938
You are in a Plesk controlled ftp environment, which is shared with a number of other users (all of whom will appear to have a complete system to themselves).

You ideally need to use the Plesk interface in order to add new users, rather than ssh, as the 'uniformity' provided by the Plesk setup will not work correctly if you start trying to modify the configuration files directly. There is also a risk that Plesk will 'revert' the files to the configuration that it thinks is correct next time the Pleask interface is used.

However, if you really wish to try (and I'm not guaranteeing that this will succeed), then you need to look at the authentication method used by /etc/proftpd.conf (or similar).

http://www.castaglia.org/proftpd/doc/contrib/ProFTPD-mini-HOWTO-ConfigFile.html

may help.

In particular, check the configuration file. The default includes:
  User nobody
  Group nogroup

(   (()
(`-' _\
 ''  ''
0
 

Author Comment

by:kwitcom
ID: 17001457
Thnx... What deleting and Copying users?
0
 

Author Comment

by:kwitcom
ID: 17001621
Took your commands and ran this and it showed a list:
cat /etc/passwd ?

tatumftp:x:10004:10001::/var/www/vhosts/tmispa.com/subdomains/ftp:/bin/false
scpuser:x:10005:50::/home/scpuser:/bin/bash

The first user works and will connect to the ftp site... I want to copy that user into the 2nd user scpuser.  After that i want to set up folders for each user to have access to and the others can't.
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 17001756
You *must* do what you are requesting through the plesk control panel. If you do thiws manually, I'm not sure that you could as you don't necessarily have access to all the necessary files...*AND* even if you did, the plesk setup is very convoluted, and I'd make loads of mistakes, and I think I know vaguely what I am trying to achieve.

What you can see is a copy of a tiny portion of the password list allocated to your environment. Without using the Plesk interface, I believe that you are limited to setting up ftp passwords *ONLY* if you run a seperate ftp server on an unpgvled port (above 1024).

(   (()
(`-' _\
 ''  ''
0
 

Author Comment

by:kwitcom
ID: 17001785
Ok in that case, what is a good program to use for ftp server that i can control the users easly and control the folders they have access to?
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 17001924
You can use any of the standard ftp servers:

vsftp:

http://vsftpd.beasts.org/

proftp:

http://www.proftpd.org/

or indeed any of the other ones available. However, I think that you are completely missing the point here in that you have a complete ftp/http/domain setup available via Plesk to enable you to do that already, along with integrated logging and other administration tools that you will 'break' by doing what you are trying to do. Use the tools that already exist in order to do the job.

(   (()
(`-' _\
 ''  ''
0
 

Author Comment

by:kwitcom
ID: 17002013
Plesk / Plesk for Unix / Plesk Control Panel
Is there a way to have multiple FTP logins per domain?
Product versions this article applies to:

    * Plesk 5.x
    * Plesk 6.x
    * Plesk 7.0.x
    * Plesk 7.1.x Reloaded
    * Plesk 7.5.x Reloaded

The latest update: Feb,09 2006
Access: public               Article ID #776

Now Plesk allows you to have only two FTP users per domain - domain FTP user and anonymous.
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 17002243
OK - Now I can see what you're trying to do. Because you can only set 1 ftp account for each domain, you are wanting to get around this. Firstly, what is wrong with giving all individuals that are modifying the domain the same user and password?

Second - the workaround for this is to create a 'sub-domain' with a username and password, and then symbolically link the ftp for that subdomain to the main domain area using ln -s.

You're right - Plesk can't cope directly with that.....but then again, I can't see a reason for it to need t o.

(   (()
(`-' _\
 ''  ''

0
 

Author Comment

by:kwitcom
ID: 17003100
Ok I found out what I am going to do.... Going to use the Web Users with Plesk and that will allow us to do what we need.  Just need to know one more thing.

I added a user with /usr/sbin/useradd now how do I remove that user?
0
 
LVL 22

Accepted Solution

by:
pjedmond earned 500 total points
ID: 17003125
userdel

or more likely:

/usr/sbin/userdel

or, you could directly edit the /etc/passwd and /etc/group....but personally I'd recommend using the above.

Also - use the Plesk panel in future for adding and deleting users - It keeps everything in synch.

(   (()
(`-' _\
 ''  ''



0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
AWS EC2 HTTP & HTTPS 2 119
PHP error function not working on AWS 10 171
Apache module 5 87
Logrotate Every Saturday 5 44
rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question