?
Solved

Linux username can't access own home directory via ftp

Posted on 2014-01-21
6
Medium Priority
?
772 Views
Last Modified: 2014-01-26
Hi,

I'm using PhpStorm as  my IDE. I set up the Auth type as OpenSSH for logging via SFTP.

I can access the the root but I can't access the username's home directory at:
/home/myultrat

the username is myultrat.

See the screenshot

But when logging in via putty to get some information on the username myultrat:
# echo ~myultrat
/home/myultrat

[/home/myultrat]# ls -al
total 108
drwx--x--x 16 myultrat myultrat 4096 Jan 13 05:08 ./
drwx--x--x 11 root     root     4096 Jan 16 02:25 ../
drwx------  2 myultrat myultrat 4096 Aug 21  2012 .HttpRequest/
drwx------  3 myultrat myultrat 4096 Aug 21  2012 .MirrorSearch/
-rw-------  1 myultrat myultrat  380 Dec  2 03:58 .bash_history
-rw-r--r--  1 myultrat myultrat   33 Aug  9  2012 .bash_logout
-rw-r--r--  1 myultrat myultrat  176 Aug  9  2012 .bash_profile
-rw-r--r--  1 myultrat myultrat  124 Aug  9  2012 .bashrc
-rw-------  1 myultrat myultrat   17 Aug  9  2012 .contactemail
drwx------  5 myultrat myultrat 4096 Dec 13 14:09 .cpanel/
-rw-r--r--  1 myultrat myultrat   16 Jan 21 01:50 .dns
-rw-------  1 myultrat myultrat   14 Jan 12 02:37 .ftpquota
-rw-r--r--  1 myultrat myultrat  964 Oct 11  2012 .htaccess
drwxr-x---  2 myultrat nobody   4096 Aug  9  2012 .htpasswds/
-rw-------  1 myultrat myultrat   13 Dec 13 14:09 .lastlogin
-rw-------  1 myultrat myultrat    3 Oct 25  2012 .mysql_history
-rw-------  1 myultrat myultrat 1024 Aug 10  2012 .rnd
drwx------  2 myultrat myultrat 4096 Aug 10  2012 .ssh/
lrwxrwxrwx  1 myultrat myultrat   34 Jul 11  2013 access-logs -> /usr/local/apac    he/domlogs/myultrat/
drwxr-xr-x  3 myultrat myultrat 4096 Aug 14  2012 classes/
drwxr-x---  3 myultrat mail     4096 Mar  4  2013 etc/
drwx------  2 myultrat myultrat 4096 Jan 13 05:08 logs/
drwxr-x--x  9 myultrat myultrat 4096 Mar  4  2013 mail/
drwxr-xr-x  2 myultrat myultrat 4096 Aug 10  2012 perl5/
drwxr-xr-x  3 myultrat myultrat 4096 Aug 11  2012 public_ftp/
drwxr-x--- 12 myultrat nobody   4096 Jan 16 02:39 public_html/
drwx------  7 myultrat myultrat 4096 Jan 13 03:34 ssl/
drwxr-xr-x  8 myultrat myultrat 4096 Mar  4  2013 tmp/
lrwxrwxrwx  1 myultrat myultrat   11 Jul 11  2013 www -> public_html/
root@ip-184-168-116-73 [/home/myultrat]# echo ~myultrat

Open in new window


I noticed that the directory:
 /home/myultrat/public_html belongs to:
myultrat:nobody

and the directory:
/home/myultrat belongs to:
myultrat:myultrat

How come I can't access /home/myultrat the sub-directories via SFTP? What permissions do I need to change? Do I need to add the username to a group?

Thanks<><
Screenshot-2014-01-21-01.07.26.png
0
Comment
Question by:Victor Kimura
[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
  • 3
  • 2
6 Comments
 
LVL 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 2000 total points
ID: 39796331
Why are you logging in as 'root' instead of 'myultrat'?  Logging in as 'myultrat' should take straight to the /home/myultrat directory.
0
 

Assisted Solution

by:Victor Kimura
Victor Kimura earned 0 total points
ID: 39796539
@Dave,

Ok, I think I see.

When I create a FTP user via cPanel then it doesn't connect via SFTP but it does with FTP.

I created an openSSH key pair for SFTP login purposes and I got the username myultrat to work. I had to configure my Mappings in the settings.

If I wanted create another SFTP login for permission access to a certain directory and sub-directories only then how would I do this? I think I recall how to create the keys for openSSH but then I don't know how that username is given access to certain directories then via SFTP.

Thank you
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 2000 total points
ID: 39797597
SFTP and SSH are regular logins like you would use to get to your own directory in '/home'.  It's the same as a telnet or plain FTP login to your own directories.  At least that's the way it has always worked for me.  I don't remember having to set anything up to use it (except for the SSH server).
0
Certified OpenStack Administrator Course

We just refreshed our COA course based on the Newton exam.  With 14 labs, this course goes over the different OpenStack services that are part of the certification: Dashboard, Identity Service, Image Service, Networking, Compute, Object Storage, Block Storage, and Orchestration.

 

Author Comment

by:Victor Kimura
ID: 39798676
Ok, I'll test it out. Thanks, Dave! =)
0
 
LVL 13

Expert Comment

by:Sandy
ID: 39799411
#setseool -P ftp_home_dir on

This will resolve your issue
0
 

Author Closing Comment

by:Victor Kimura
ID: 39809848
I created an openSSH key pair for SFTP login purposes and I got the username myultrat to work. I had to configure my Mappings in the settings.
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Suggested Courses
Course of the Month13 days, 6 hours left to enroll

777 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