Jump to content











Photo
- - - - -

Debian root login directory

debian linux terminal linux console changing directory linux root


  • Please log in to reply
7 replies to this topic

#1 Gh0sty

Gh0sty
  • Members
  • 5 posts
  •  
    New Zealand

Posted 14 July 2015 - 03:49 AM

Hi Guys (and Gals)

 

I am just trying to find out if there is a way to set the default "login directory" when you login as root under a Debian system.

For this to be a clearer topic I will provide more information below:

 

System: Debian bare-bones (customized), no GUI - just a console based system.

 

Issue: When I log in as root, before I can begin to do any work I need to type:

cd .. 

If I don't I can't view, for example, my "/tftpboot" folder where my PXE setup is currently located

 

Request: Is there any way that I can have it that when I login as "Root" that I no longer need to type that so that I can just get into work.

 

I know it's not really a big deal to type this but doing it every time gets quiet annoying specially when I'm rebooting multiple times a day for testing reasons.



#2 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 14 July 2015 - 09:06 AM   Best Answer

Check your /etc/passwd :
http://www.cyberciti...wd-file-format/
http://askubuntu.com...ctory-in-ubuntu

:duff:
Wonko

#3 dog

dog

    Frequent Member

  • Expert
  • 236 posts

Posted 14 July 2015 - 03:39 PM

You probably don't want to use / as your home, and you'd still have to do

cd /tftpboot

anyway. You definitely don't want to use /tftpboot as your home, as tftp has no security at all, and home is where your private files live.

Could try this, if you're willing to risk breaking your system:

echo "cd /tftpboot">>~/.profile



#4 Gh0sty

Gh0sty
  • Members
  • 5 posts
  •  
    New Zealand

Posted 15 July 2015 - 11:51 PM

Thanks Wonko and Dog.

 

Wonko provided more what I was after. I think dog may have misinterpreted my answer, I'm not really after having my home in "/tftpboot" just trying to get rid of the "cd .." that I have to type each time.

 

So I will apply Wonko's option and move from there.

 

Thanks fellas :)



#5 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 16 July 2015 - 12:41 PM

If you change /etc/passwd, you are changing your home directory, which is not recommended (at least not changing it to "/" or "/tftpboot").

 

The instructions of dog are more appropiate.

 

Or if you want to be in the "/" dir, use:

echo "cd /" >> ~/.profile


#6 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 16 July 2015 - 12:48 PM

... or move the /tftboot inside the default root home directory .....

 

:duff:

Wonko



#7 Gh0sty

Gh0sty
  • Members
  • 5 posts
  •  
    New Zealand

Posted 16 July 2015 - 09:11 PM

Haha thanks, but like I said it's not really about the tftpboot directory more than it is about the actual cd .. because I also need to look at my samba directory, my www directory etc.

tftpboot was merely an example as that is what I am currently working on tidying up.



#8 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 17 July 2015 - 09:20 AM

Good. :)

The point that Icecube correctly raised :worship: is that changing the path in /etc/password you are changing the default home directory of the root account, whilst inserting a "cd .." or "cd /" command in ~/.profile you are simply automating the issuing of the same command you are now giving manually at each login.

 

:duff:

Wonko







Also tagged with one or more of these keywords: debian, linux, terminal, linux console, changing directory, linux root

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users