Sponsored Content
Top Forums Programming Users to submit email for ftp creation Post 303000507 by robertkwild on Thursday 13th of July 2017 11:17:24 AM
Old 07-13-2017
Users to submit email for ftp creation

hi all,

created a bash script to create an ftp account, its here -

Code:
#!/bin/bash

dir=/mnt/sftp
group=sftp_users

    echo "Enter UserName:"
    read user

    if id $user ; then
        echo "$user already exists as you can see above, please re-run the script"
        exit
        else
        echo "$user not in system, ok to continue"
    fi

    echo "Enter Password:"
    read passwd
    echo "$user:$passwd" >> /ftp_details/accounts.csv
    echo "is this a normal user (press 1) or vfx user (press 2) ?"
    read choice
    
    case $choice in
        1)
            useradd -g $group -d /upload -s /sbin/nologin $user
            mkdir -p $dir/$user/upload
            chown $user:$group $dir/$user/upload
            touch $dir/$user/upload/WARNING_everything_in_here_will_get_removed_in_14_days_time.txt
            ;;
        2)
            useradd $user -s /sbin/nologin -b /mnt/vfx/
            ;;
        *)
            echo "invalid selection, please re-run the script"
            exit
            ;;
    esac

    echo $user:$passwd | chpasswd

it works great but now i want to do something else which i dont know if possible but i will try and explain

i want the end user/customer/client or whoever submits an ftp user creation for us to send an email to sftp.molinare.co.uk and when they email it, the sftp server i created with the script will pick up what username and password they want to make the ftp account and it will create it and then send them an email saying the ftp account has been created with the username/password they gave

obviously i will configure postfix SMTP on the sftp server so it can do this

cheers,

rob
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

How to change default email sent to new users

Hello all, I have a question about the email that is sent to new users when they first check their email. The message is directly from the server and says something like "Welcome to "mailserver", you login is atypical." Where is this message? Can I change the message that is sent? Were... (2 Replies)
Discussion started by: calivw78
2 Replies

2. Forum Support Area for Unregistered Users & Account Problems

now 4 users created, still no email

I'm sorry for being an annoyance. I did read in another post that anyone who gives a proper email address will receive a confirmation. Well, I have created 4 accounts to no avail. Who knows, maybe I did mistype my email in one of them (twice since we have to reconfirm and with the same typo),... (3 Replies)
Discussion started by: seaghan
3 Replies

3. UNIX for Dummies Questions & Answers

email users isssue

Hi, my email server is set up in a different machine which runs lineox enterprise 3.0. It exports /var/spool/mail to the sun server running solaris 9 and hence, all workstations nd users can access their mail. but the problem is some users cannot open their mail at all. the error "mailer... (0 Replies)
Discussion started by: stakes20
0 Replies

4. UNIX for Dummies Questions & Answers

send email to more users

Hi, If I want to send an email to serveral users, what is the correct way to do it? I know a little bit mail command. If I want to send email to John and Scott after UNIX shell scripts have completed the job. I type: mail -s 'Job has been completed successfully' john@yahoo.com < log.txt ... (4 Replies)
Discussion started by: duke0001
4 Replies

5. Solaris

creation of users

Hello, I'm preparing a script for creating users automatically. I,m using this command useradd -c "Name foo" -d /export/home/my -f 10 -g other -u 10001 -s /bin/bash my the problem i have is when i create the user by command line, this acount is locked. What do i have to change in the... (2 Replies)
Discussion started by: javierg
2 Replies

6. UNIX for Dummies Questions & Answers

to send email to multiple users

hi, i'm pretty new to this unix. i've been asked to create a shell script which will pick up the email id from a text file(stored in same machine, same directory) searches for that id in another file in which a product name( a one line text) is mentioned against it. then it should send a mail... (0 Replies)
Discussion started by: vishwas.shenoy
0 Replies

7. Shell Programming and Scripting

FTP and LOg file creation

Hello, I am new to unix , and I need to create a shell sciprt which helps me FTPing file from LAn to Unix box. These files r then processed using Perl script and put in a database. I also need to log the entire process of all the above methods in a log file in the same shell script. Like ,... (2 Replies)
Discussion started by: agarwalniru
2 Replies

8. Shell Programming and Scripting

Sending an email to group of users

Hi , I want to write a Unix script which can send an automatic email to the group when my job is completed.I'm trying the following Mail -s "test" <groupname> << EOD >Completed >EOD With this i'm not able to send an email to group..Any ideas? Thanks in Advance (1 Reply)
Discussion started by: BhawanaAggarwal
1 Replies

9. UNIX for Dummies Questions & Answers

Help: Add email users in OSX terminal

Please forgive me if this is the wrong place to post. I am a VERY basic user here and have been tasked with adding a user to our email system -- we use a squirrelmail interface and I have root passwords etc. I tried logging in through a browser but get this error: ERROR: Connection dropped... (1 Reply)
Discussion started by: dperro01
1 Replies

10. UNIX for Beginners Questions & Answers

Email the users about their existing groups

Hi Guys, I want a script where in I need to send an email to individual users about their groups. OS:unix redhat Shell :Bash. The mail should be like,"Hi &username , you are in part of &group1,&group2 .." I need to mail to their personal email id mostly @outlook. Not to their UNIX.... (1 Reply)
Discussion started by: vijay2107
1 Replies
ftpconfig(1M)                                             System Administration Commands                                             ftpconfig(1M)

NAME
ftpconfig - set up anonymous FTP SYNOPSIS
ftpconfig [ftpdir] ftpconfig -d ftpdir DESCRIPTION
The ftpconfig script is executed by the super user to set up anonymous FTP. Anonymous FTP allows users to remotely log on to the FTP server by specifying the user name ftp or anonymous and the user's email address as password. The anonymous users are logged on to the FTP Server and given access to a restricted file area with its own file system root. See chroot(2). The FTP area has its own minimal system files. This command will copy and set up all the components needed to operate an anonymous FTP server, including creating the ftp user account, creating device nodes, copying /usr/lib files, and copying timezone data. The passwd and group files set up have been stripped down to prevent malicious users from finding login names on the server. The anonymous file area will be placed under ftpdir. If the ftp user account already exists, then the current FTP area is used, and the system files in it are updated. All other files are left untouched. This command should be run to update the anonymous FTP area's configuration whenever a system patch is installed, or the system is upgraded. OPTIONS
-d Create a new or update an existing ftpdir without creating or updating the ftp user account. Use this option when creating guest FTP user accounts. OPERANDS
The following operands are supported: ftpdir The absolute pathname of the directory under which the anonymous FTP area is set up. EXIT STATUS
The following exit values are returned: 0 Successful completion 1 Improper usage of the command 2 Command failed ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWftpu | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
ftpaddhost(1M), in.ftpd(1M), useradd(1M), chroot(2), attributes(5) SunOS 5.10 1 May 2003 ftpconfig(1M)
All times are GMT -4. The time now is 10:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy