Change ssh login home directory

Backup, Restore, Netbak Replicator, Cloud Storage Services
Post Reply
oakfield
Starting out
Posts: 14
Joined: Mon Mar 14, 2011 4:05 am

Change ssh login home directory

Post by oakfield »

Hi there,

I've done a lot of searching and I've come to a bit of an end with what I can get working. Until a few firmware revisions ago I had a really nice cron job that would rsync a number of folders on my computer to my NAS. This sadly no longer works and I wanted to get it working again. It seems that now when I ssh into my NAS I get to I don't quite know where that has the index_default.html file of the webserver/web page as the only thing in the directory. using either cd .. or cd / (obviously) takes me back to the top level of the NAS.

Is there a way that I can change where I 'get to' when I login - I want to go directly to / on login. I've tried changing the passwd file from /share/homes/admin:/bin/sh but that made no difference. Any other suggestions really, really welcome as I'm rather lost now!

Thanks
User avatar
pwilson
Guru
Posts: 22533
Joined: Fri Mar 06, 2009 11:20 am
Location: Victoria, BC, Canada (UTC-08:00)

Re: Change ssh login home directory

Post by pwilson »

oakfield wrote:Hi there,

I've done a lot of searching and I've come to a bit of an end with what I can get working. Until a few firmware revisions ago I had a really nice cron job that would rsync a number of folders on my computer to my NAS. This sadly no longer works and I wanted to get it working again. It seems that now when I ssh into my NAS I get to I don't quite know where that has the index_default.html file of the webserver/web page as the only thing in the directory. using either cd .. or cd / (obviously) takes me back to the top level of the NAS.

Is there a way that I can change where I 'get to' when I login - I want to go directly to / on login. I've tried changing the passwd file from /share/homes/admin:/bin/sh but that made no difference. Any other suggestions really, really welcome as I'm rather lost now!
This is one of several complaints about QNAP's still broken SSHd implementation. It does not respect the $HOME directory as listed in /etc/passwd file.
Despite the fact that your /etc/passwd tells it to login you into /share/homes/admin, but it will instead log you into /root instead.

Don't bother customizing your .profile & .bashrc files located in /root, as they get overwritten at every reboot for your added convenience. I have complained about this for the past 7 or so Firmware revisions, but QNAP (for unpublished reasons) continues to perpetuate this bug, firmly ignoring it's customers when we bring it to their attention.

It is possible to swap-out QNAP's still broken SSHd daemon, but doing so is a rather difficult effort, which is completely unsupported by QNAP. Please see my previous message: [HOW-TO] Install OpenSSH as default SSHd Server for one possible solution to the problem. Please read the entire thread, as there are pitfalls, as well as advantages to my solution, and it dramatically changes access to the NAS, which can introduce security issues. Please understand both the pitfalls and benefits of my solution before you decide to follow it.

My guide (in that message thread) is the only assistance you will likely receive, so if you aren't confident that you can do it, please don't attempt it. I do not want to be held responsible for the side-effects of this solution. It works for me, but that is all I'm willing to guarantee, as your outcome may be different than mine. Hopefully at some point QNAP will take the complaints about "their" still broken SSHd implementation seriously, and actually provide relief for you and I by actually squashing this bug once and for all. We have suffered long enough, it's time to fix this long standing QNAP Firmware bug.

PS: QNAP introduced an additional bug in Firmware v3.8.2, such that the "autorun.sh" file does not work correctly in this version of the Firmware, so you might need to suffer until QNAP releases Firmware v3.8.3 to address this issue, or downgrade to Firmware v3.8.1, in order to implement this.

Patrick M. Wilson
Victoria, BC Canada
QNAP TS-470 Pro w/ 4 * Western Digital WD30EFRX WD Reds (RAID5) - - Single 8.1TB Storage Pool FW: QTS 4.2.0 Build 20151023 - Kali Linux v1.06 (64bit)
Forums: View My Profile - Search My Posts - View My Photo - View My Location - Top Community Posters
QNAP: Turbo NAS User Manual - QNAP Wiki - QNAP Tutorials - QNAP FAQs

Please review: When you're asking a question, please include the following.
User avatar
doktornotor
Ask me anything
Posts: 7472
Joined: Tue Apr 24, 2012 5:44 am

Re: Change ssh login home directory

Post by doktornotor »

pwilson wrote:PS: QNAP introduced an additional bug in Firmware v3.8.2, such that the "autorun.sh" file does not work correctly in this version of the Firmware, so you might need to suffer until QNAP releases Firmware v3.8.3 to address this issue, or downgrade to Firmware v3.8.1, in order to implement this.
This is still broken in 4.0.0 (beta?) as well; not convinced they'll ever fix the damned thing. :x
I'm gone from this forum till QNAP stop wasting volunteers' time. Get help from QNAP helpdesk instead.
Warning: offensive signature and materials damaging QNAP reputation follow:
QNAP's FW security issues
QNAP's hardware compatibility list madness
QNAP's new logo competition
Dear QNAP, kindly fire your clueless incompetent forum "admin" And while at it, don't forget the webmaster!
oakfield
Starting out
Posts: 14
Joined: Mon Mar 14, 2011 4:05 am

Re: Change ssh login home directory

Post by oakfield »

Thanks for the reply Patrick, I'm very glad that it's not just me being daft! I'm reasonably happy with my ability to swap out the SSHd daemon, but it's not the end of the world for me right now to just leave it as it is. I would rather like the cron job to happen, but it's not the end of the world with it not happening.

Guess I'm waiting for QNAP to sort this out. Along with the issue with the Multimedia Station not liking song titles or artists with special characters in the name. Damn Sigur Ros and all their oddly named tracks!
User avatar
pwilson
Guru
Posts: 22533
Joined: Fri Mar 06, 2009 11:20 am
Location: Victoria, BC, Canada (UTC-08:00)

Re: Change ssh login home directory

Post by pwilson »

oakfield wrote:Thanks for the reply Patrick, I'm very glad that it's not just me being daft! I'm reasonably happy with my ability to swap out the SSHd daemon, but it's not the end of the world for me right now to just leave it as it is. I would rather like the cron job to happen, but it's not the end of the world with it not happening.

Guess I'm waiting for QNAP to sort this out. Along with the issue with the Multimedia Station not liking song titles or artists with special characters in the name. ** Sigur Ros and all their oddly named tracks!
Ah cron, that is a different issue. Welcome to QNAP's still broken Cron Scheduler too. This is yet another "still broken" basic Linux functionality in QNAP's firmware. QNAP is only been in the NAS game for 10 years, so I'm sure they'll eventually fix it too. In the interim, check out QNAPedia article: Add items to crontab, which explains the nasty "workaround" required to add items to the Cron Task Scheduler.

QNAP still does not provide any form of Admin WebUI solution to schedule cron tasks (without going to the command line), and standard Linux methods do not work (even from the command line), as QNAP's crond scheduler is incompatible with their "crontab" command. QNAP are excellent at making each new Firmware revision "prettier" and "slower", but they never seem to even attempt to fix the years old, (in some cases decade old) bugs.

QNAP has provided a proper working ntpd daemon in their firmware for the last 7 Firmware revisions, but they still don't actually use it. They continue to provide and use a broken ntpdate command instead. Firmware v3.8.3 should fix the "autorun" bug found on the ARM units under v3.8.2, but I sincerely doubt that QNAP has even looked at the Cron/Crontab or NTPd/ntpdate issues/bugs in years, and I doubt this will change this time around.

Patrick M. Wilson
Victoria, BC Canada
QNAP TS-470 Pro w/ 4 * Western Digital WD30EFRX WD Reds (RAID5) - - Single 8.1TB Storage Pool FW: QTS 4.2.0 Build 20151023 - Kali Linux v1.06 (64bit)
Forums: View My Profile - Search My Posts - View My Photo - View My Location - Top Community Posters
QNAP: Turbo NAS User Manual - QNAP Wiki - QNAP Tutorials - QNAP FAQs

Please review: When you're asking a question, please include the following.
Post Reply

Return to “Backup & Restore”