?
Solved

home directory for a new user

Posted on 2011-04-28
16
Medium Priority
?
332 Views
Last Modified: 2012-06-27
i have add a new user from webmin.

i changed is home dir to /ftpdata

but when i log on the consol i get

-bash-3.2$

what is this error and how can i fix it

i am using centos 5.5

thanks
0
Comment
Question by:GCI_SUPPORT
16 Comments
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 35486803
That's not an error, that's the prompt. Issue "pwd" to see where you are.

wmp
0
 

Author Comment

by:GCI_SUPPORT
ID: 35486817
what i mean is a set the home directory to /ftpdata

when i try  pwd, i am in /
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 35486834
Is the user allowed to access /ftpdata?

ls -ld /ftpdata

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:GCI_SUPPORT
ID: 35486850
drwxrwxrwx 3 liveupdate root 4096 Apr 28 12:06 /ftpdata
0
 
LVL 16

Expert Comment

by:Joseph Gan
ID: 35486854
The user home directory is defind in /etc/passwd file.
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 35486874
grep user /etc/passwd

The home directory is in the 6th colon-delimited field. Is it correct?
0
 

Author Comment

by:GCI_SUPPORT
ID: 35486884

-bash-3.2$ grep user /etc/passwd
rpc:x:32:32:Portmapper RPC user:/:/sbin/nologin
rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin
sabayon:x:86:86:Sabayon user:/home/sabayon:/sbin/nologin
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 35486886
"usermod -d /ftpdata user"

if it's wrong.

0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 35486896
None of the listed users has /ftpdata as its home!
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 35486907
... and with "user" I meant the user's account name, not the word "user"!
0
 

Author Comment

by:GCI_SUPPORT
ID: 35486952
forget about it , i have change the homde directory and it work, but my only problem is when i  connect to my ftp the home directory is good but i am not able to create folder
0
 

Author Comment

by:GCI_SUPPORT
ID: 35486967
here my conf


# Example config file /etc/vsftpd/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=NO
#
# Uncomment this to allow local users to log in.
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
local_umask=022
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
#anon_upload_enable=YES
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# The target log file can be vsftpd_log_file or xferlog_file.
# This depends on setting xferlog_std_format parameter
xferlog_enable=YES
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# The name of log file when xferlog_enable=YES and xferlog_std_format=YES
# WARNING - changing this filename affects /etc/logrotate.d/vsftpd.log
#xferlog_file=/var/log/xferlog
#
# Switches between logging into vsftpd_log_file and xferlog_file files.
# NO writes to vsftpd_log_file, YES to xferlog_file
xferlog_std_format=YES
#
# You may change the default value for timing out an idle session.
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#nopriv_user=ftpsecure
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
# You may fully customise the login banner string:
ftpd_banner=Welcome to GCI LIVEUPDATE FTP service.
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#deny_email_enable=YES
# (default follows)
#banned_email_file=/etc/vsftpd/banned_emails
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
#chroot_list_enable=YES
# (default follows)
#chroot_list_file=/etc/vsftpd/chroot_list
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
#ls_recurse_enable=YES
#
# When "listen" directive is enabled, vsftpd runs in standalone mode and
# listens on IPv4 sockets. This directive cannot be used in conjunction
# with the listen_ipv6 directive.
listen=YES
#
# This directive enables listening on IPv6 sockets. To listen on IPv4 and IPv6
# sockets, you must run two copies of vsftpd whith two configuration files.
# Make sure, that one of the listen options is commented !!
#listen_ipv6=YES

pam_service_name=vsftpd
userlist_enable=NO
tcp_wrappers=YES
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 35487043
Should work perfectly.

Which way are you attempting to create a folder, and which is the error message you get?
0
 
LVL 31

Expert Comment

by:farzanj
ID: 35487108
Issue these two commands
echo $HOME
ls ~
0
 
LVL 1

Accepted Solution

by:
leader716 earned 2000 total points
ID: 35487401
It's probably SELinux blocking the creation through FTP.
0
 

Author Comment

by:GCI_SUPPORT
ID: 35488158
so how you disable the selinux
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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…
Suggested Courses
Course of the Month16 days, 7 hours left to enroll

862 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