Synology icon indicating copy to clipboard operation
Synology copied to clipboard

Changing the login shell of a user with syno* tools?

Open miguno opened this issue 5 years ago • 6 comments

Do you happen to know if any of the syno* command line tools allow you to change the login shell of a user?

sh-4.3# synouser --get wuseman
User Name   : [wuseman]
User Type   : [AUTH_LOCAL]
User uid    : [1026]
Primary gid : [100]
Fullname    : []
User Dir    : [/var/services/homes/wuseman]
User Shell  : [/bin/sh]                        <===== HERE
Expired     : [false]
User Mail   : []
Alloc Size  : [82]
Member Of   : [2]
(100) users
(101) administrators

For what it's worth, manually fiddling with /etc/passwd (like one would on a normal, non-Synology OS) doesn't work with the latest DSM versions, at least from what I can tell. And standard tools like chsh don't exist on the Synology NAS.

miguno avatar Mar 20 '20 22:03 miguno

any solution to this?

ArcSpecter avatar Jul 10 '21 03:07 ArcSpecter

Any solution? Changing the /etc/passwd makes it impossible to ssh so looking for "The Syno Way"...

ThomasDalla avatar Nov 27 '21 11:11 ThomasDalla

Any solution? Changing the /etc/passwd makes it impossible to ssh so looking for "The Syno Way"...

@ThomasDalla - just found this out the hard way. What was your solution to changing the /etc/passwd file back? Syno make it quite hard to edit these sort of files from their desktop!

jt196 avatar Dec 21 '21 11:12 jt196

@jt196 I was able to reset the /etc/passwd file by creating a new test user through DSM Control Panel > User & Group, which fixed ssh access for me.

ghost avatar Jan 02 '22 05:01 ghost

FYI this worked for me. Which was to:

  1. Create a file named .profile in the user folder
  2. Append the following text:
if [[ -x /usr/local/bin/zsh ]]; then
  export SHELL=/usr/local/bin/zsh
  exec /usr/local/bin/zsh
fi
  1. Log out, log in and everything should work ok. All the files are in the user home as well, so easily accessible.

jt196 avatar Jan 02 '22 10:01 jt196

Thanks for sharing this info, @jt196. The link you mentioned above about installing Oh My ZSH on Synology is broken, however. The working one is: https://3os.org/infrastructure/synology/Install-oh-my-zsh/

miguno avatar Apr 08 '22 18:04 miguno