Solved

SSH LINUX CREATE FTP ACCOUNTS

Posted on 2006-06-27
16
271 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
  • 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
 

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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now