LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-22-2013, 03:51 AM   #1
Reprovo
Member
 
Registered: Jul 2013
Posts: 59

Rep: Reputation: Disabled
Can't access my user home directory from terminal (Debian)


Hi.I'm trying to access my home/username/desktop folder from terminal but there Is no directory listed under home#. I was trying to move a .html file from the desktop to var/www and came across this Issue.
 
Old 10-22-2013, 04:20 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
You mention /home/<username>/desktop. That should be /home/<username>/Desktop. Linux is case sensitive.
 
Old 10-22-2013, 04:23 AM   #3
Reprovo
Member
 
Registered: Jul 2013
Posts: 59

Original Poster
Rep: Reputation: Disabled
Sorry.I mean there's nothing In the home directory. ls or ls-a gives nothing.
If I type cd It gives me /home/<username> :No such file or directory.
 
Old 10-22-2013, 04:34 AM   #4
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,298
Blog Entries: 61

Rep: Reputation: Disabled
Strange. Did you create a user during installation?
 
Old 10-22-2013, 04:35 AM   #5
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Quote:
Originally Posted by Reprovo View Post
Sorry.I mean there's nothing In the home directory. ls or ls-a gives nothing.
If I type cd It gives me /home/<username> :No such file or directory.
What exactly are you doing? I can only assume you are logged in as a specific user (say user X) and started a terminal. After starting the terminal you should be standing in the home directory of user X.

Can you post the output of the following commands:
Code:
id -un
ls -ld $HOME
ls -a $HOME
 
Old 10-22-2013, 04:49 AM   #6
Reprovo
Member
 
Registered: Jul 2013
Posts: 59

Original Poster
Rep: Reputation: Disabled
@brian , I did create a user yes.

nikolas@Niko:/$
id -un
nikolas

ls -ld $home
drwxr-xr-x 22 root 4096 jun 16 09:41 .

ls -a $HOME
. boot home lost+found opt sbin sys usr
.. dev initrd.img media proc selinux tmp var
bin etc lib mnt root srv .ure vmlinuz
 
Old 10-22-2013, 05:03 AM   #7
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
You need to be precise: ls -ld $home should be ls -ld $HOME

How and when did you create this user (nikolas).
How are you logged in ("normal" using GUI, using the CLI or from a remote machine using ssh or ...)?

This doesn't look correct either:
Quote:
ls -a $HOME
. boot home lost+found opt sbin sys usr
.. dev initrd.img media proc selinux tmp var
bin etc lib mnt root srv .ure vmlinuz
It shows the content of the root directory (/) instead of /home/nikolas.

What does the following command show:
Code:
grep nikolas /etc/passwd
 
Old 10-22-2013, 05:38 AM   #8
Reprovo
Member
 
Registered: Jul 2013
Posts: 59

Original Poster
Rep: Reputation: Disabled
Sorry typed ls -a $HOME Incorrectly also.I'm logged in via the GUI on a virtual machine.
both ls -a $HOME and ls -ld $HOME give:
ls: cannot access /home/nikolas: No such file or directory

grep nikolas /etc/passwd

nikolas:x:1000:1000:Nikolas Nik,,,:/home/nikolas:/bin/bash

Last edited by Reprovo; 10-22-2013 at 05:40 AM.
 
Old 10-22-2013, 05:48 AM   #9
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
The entry in /etc/passwd looks correct, but....

Its starting to look like you do not have a home directory for nikolas any more, which would explain the output show in your previous post (#6). Some way, somehow the home directory for this user was removed or moved to a different location/name.
 
Old 10-22-2013, 05:51 AM   #10
Madhu Desai
Member
 
Registered: Mar 2013
Distribution: Rocky, Fedora, Ubuntu
Posts: 541

Rep: Reputation: 153Reputation: 153
Quote:
Originally Posted by Reprovo View Post
Hi.I'm trying to access my home/username/desktop folder from terminal but there Is no directory listed under home#. I was trying to move a .html file from the desktop to var/www and came across this Issue.
what command did you issue to move .html to /var/www. did you check whats in /var/www ?
 
Old 10-22-2013, 05:57 AM   #11
Reprovo
Member
 
Registered: Jul 2013
Posts: 59

Original Poster
Rep: Reputation: Disabled
the default index.html is in var/www.
cd /var/www/
mv ~Desktop/webpage.html .
 
Old 10-22-2013, 06:28 AM   #12
Madhu Desai
Member
 
Registered: Mar 2013
Distribution: Rocky, Fedora, Ubuntu
Posts: 541

Rep: Reputation: 153Reputation: 153
hmmm, couple of clarifications:

Did you mean 'mv ~/Desktop/webpage.html .' ?

Did you move file as nikolas user or root user. Cause, as nikolas user, you can goto /var/www, but you cannot move file from desktop to /var/www. However, if you move file as root user, then ~/Desktop folder you mentioned is of user root, not of user nikolas.

Anyway, try locate to find out if the /home/nikolas has wandered somewhere else

Code:
# updatedb
# locate -i *nikolas/Desktop*
 
Old 10-22-2013, 07:02 AM   #13
Reprovo
Member
 
Registered: Jul 2013
Posts: 59

Original Poster
Rep: Reputation: Disabled
Thanks! I managed to move /nikolas into var/www like the noob that I am.Sorry yes I did mean /Desktop.I'm not sure what I did though.What error did I make In the mv command to cause It to move the home/nikolas folder into var/www?
 
Old 10-22-2013, 07:37 AM   #14
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Quote:
Originally Posted by Reprovo View Post
What error did I make In the mv command to cause It to move the home/nikolas folder into var/www?
I can only guess, which I won't do. Have a look at your .bash_history file, it should contain the command you used.
 
Old 10-22-2013, 07:50 AM   #15
Reprovo
Member
 
Registered: Jul 2013
Posts: 59

Original Poster
Rep: Reputation: Disabled
Thanks for your time everyone !
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to create a user, who can access only his home directory suresh.k Linux - Newbie 7 09-14-2012 07:25 AM
How to give access to user only home directory through ssh? jeevar Linux - Newbie 1 08-06-2012 08:51 AM
debian user home directory afzalmasood Debian 5 07-22-2008 10:31 AM
Access Home Directory on the Debian 3.1 Server Remotly via Browser? ischi Linux - Server 4 04-26-2008 10:25 AM
Deny user access to terminal/directory browsing intranet_man Linux - Networking 2 03-22-2006 12:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration